diff options
Diffstat (limited to '_build/static/archives/extend/attachments/20150125/370811e4/attachment-0001.html')
-rw-r--r-- | _build/static/archives/extend/attachments/20150125/370811e4/attachment-0001.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/_build/static/archives/extend/attachments/20150125/370811e4/attachment-0001.html b/_build/static/archives/extend/attachments/20150125/370811e4/attachment-0001.html new file mode 100644 index 00000000..7783cc74 --- /dev/null +++ b/_build/static/archives/extend/attachments/20150125/370811e4/attachment-0001.html @@ -0,0 +1,25 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5"><br> +</HEAD><br> +<BODY><br> +I am trying to write a middleware step that will modify the URL in a request before it gets to the default static request handler. I can not find an example of how to do this. What I have so far:<BR><br> +<BR><br> +execute( Req, Env ) -><BR><br> + HostUrl = cowboy_req:host_url(Req),<BR><br> + NewUrl = rewrite( HostUrl ),<BR><br> + NewReq = ???<BR><br> + {ok, NewReq, Env}.<BR><br> +<BR><br> +How do I modify a Request object so that it contains my modified URL, which cowboy_static will then process normally? My 'rewrite' function converts logical directory names into real file-system paths, using a dynamic algorithm that can not be simply written into cowboy's dispatch rules.<BR><br> +<BR><br> +The dispatch rules I am using is as follows, where 'bz_libmap' is my module containing the code above:<BR><br> + {"/music/[...]", cowboy_static, {dir, bz_libmap, ""}},<BR><br> +<BR><br> +</BODY><br> +</HTML><br> + +</tt> |