summaryrefslogtreecommitdiffstats
path: root/_build/static/archives/extend/attachments/20150125/370811e4/attachment-0001.html
diff options
context:
space:
mode:
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.html25
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>
+&lt;!DOCTYPE&nbsp;HTML&nbsp;PUBLIC&nbsp;&quot;-//W3C//DTD&nbsp;HTML&nbsp;4.0&nbsp;TRANSITIONAL//EN&quot;&gt;<br>
+&lt;HTML&gt;<br>
+&lt;HEAD&gt;<br>
+&nbsp;&nbsp;&lt;META&nbsp;HTTP-EQUIV=&quot;Content-Type&quot;&nbsp;CONTENT=&quot;text/html;&nbsp;CHARSET=UTF-8&quot;&gt;<br>
+&nbsp;&nbsp;&lt;META&nbsp;NAME=&quot;GENERATOR&quot;&nbsp;CONTENT=&quot;GtkHTML/4.8.5&quot;&gt;<br>
+&lt;/HEAD&gt;<br>
+&lt;BODY&gt;<br>
+I&nbsp;am&nbsp;trying&nbsp;to&nbsp;write&nbsp;a&nbsp;middleware&nbsp;step&nbsp;that&nbsp;will&nbsp;modify&nbsp;the&nbsp;URL&nbsp;in&nbsp;a&nbsp;request&nbsp;before&nbsp;it&nbsp;gets&nbsp;to&nbsp;the&nbsp;default&nbsp;static&nbsp;request&nbsp;handler.&nbsp;&nbsp;I&nbsp;can&nbsp;not&nbsp;find&nbsp;an&nbsp;example&nbsp;of&nbsp;how&nbsp;to&nbsp;do&nbsp;this.&nbsp;&nbsp;What&nbsp;I&#12288;have&nbsp;so&nbsp;far:&lt;BR&gt;<br>
+&lt;BR&gt;<br>
+execute(&nbsp;Req,&nbsp;Env&nbsp;)&nbsp;-&gt;&lt;BR&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;HostUrl&nbsp;=&nbsp;cowboy_req:host_url(Req),&lt;BR&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;NewUrl&nbsp;=&nbsp;rewrite(&nbsp;HostUrl&nbsp;),&lt;BR&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;NewReq&nbsp;=&nbsp;???&lt;BR&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;{ok,&nbsp;NewReq,&nbsp;Env}.&lt;BR&gt;<br>
+&lt;BR&gt;<br>
+How&nbsp;do&nbsp;I&nbsp;modify&nbsp;a&nbsp;Request&nbsp;object&nbsp;so&nbsp;that&nbsp;it&nbsp;contains&nbsp;my&nbsp;modified&nbsp;URL,&nbsp;which&nbsp;cowboy_static&nbsp;will&nbsp;then&nbsp;process&nbsp;normally?&nbsp;&nbsp;My&nbsp;'rewrite'&nbsp;function&nbsp;converts&nbsp;logical&nbsp;directory&nbsp;names&nbsp;into&nbsp;real&nbsp;file-system&nbsp;paths,&nbsp;using&nbsp;a&nbsp;dynamic&nbsp;algorithm&nbsp;that&nbsp;can&nbsp;not&nbsp;be&nbsp;simply&nbsp;written&nbsp;into&nbsp;cowboy's&nbsp;dispatch&nbsp;rules.&lt;BR&gt;<br>
+&lt;BR&gt;<br>
+The&nbsp;dispatch&nbsp;rules&nbsp;I&nbsp;am&nbsp;using&nbsp;is&nbsp;as&nbsp;follows,&nbsp;where&nbsp;'bz_libmap'&nbsp;is&nbsp;my&nbsp;module&nbsp;containing&nbsp;the&nbsp;code&nbsp;above:&lt;BR&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&quot;/music/[...]&quot;,&nbsp;cowboy_static,&nbsp;{dir,&nbsp;bz_libmap,&nbsp;&quot;&quot;}},&lt;BR&gt;<br>
+&lt;BR&gt;<br>
+&lt;/BODY&gt;<br>
+&lt;/HTML&gt;<br>
+
+</tt>