doc/rdoc/classes/Mongrel/DirHandler.html in mongrel-0.3.13.4 vs doc/rdoc/classes/Mongrel/DirHandler.html in mongrel-1.0

- old
+ new

@@ -86,13 +86,13 @@ the files are located, and it tries to find the files based on the PATH_INFO inside the directory. If the requested path is a directory then it returns a simple directory listing. </p> <p> -It does a simple protection against going outside it&#8217;s root path by +It does a simple protection against going outside it&#8216;s root path by converting all paths to an absolute expanded path, and then making sure -that the final expanded path includes the root path. If it doesn&#8217;t +that the final expanded path includes the root path. If it doesn&#8216;t than it simply gives a 404. </p> <p> The default content type is &quot;text/plain; charset=ISO-8859-1&quot; but you can change it anything you want using the @@ -106,16 +106,16 @@ <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> - <a href="#M000054">add_mime_type</a>&nbsp;&nbsp; - <a href="#M000050">can_serve</a>&nbsp;&nbsp; - <a href="#M000049">new</a>&nbsp;&nbsp; - <a href="#M000053">process</a>&nbsp;&nbsp; - <a href="#M000051">send_dir_listing</a>&nbsp;&nbsp; - <a href="#M000052">send_file</a>&nbsp;&nbsp; + <a href="#M000056">add_mime_type</a>&nbsp;&nbsp; + <a href="#M000052">can_serve</a>&nbsp;&nbsp; + <a href="#M000051">new</a>&nbsp;&nbsp; + <a href="#M000055">process</a>&nbsp;&nbsp; + <a href="#M000053">send_dir_listing</a>&nbsp;&nbsp; + <a href="#M000054">send_file</a>&nbsp;&nbsp; </div> </div> </div> @@ -129,13 +129,18 @@ <h3 class="section-bar">Constants</h3> <div class="name-list"> <table summary="Constants"> <tr class="top-aligned-row context-row"> + <td class="context-item-name">MIME_TYPES_FILE</td> + <td>=</td> + <td class="context-item-value">&quot;mime_types.yml&quot;</td> + </tr> + <tr class="top-aligned-row context-row"> <td class="context-item-name">MIME_TYPES</td> <td>=</td> - <td class="context-item-value">{ &quot;.css&quot; =&gt; &quot;text/css&quot;, &quot;.gif&quot; =&gt; &quot;image/gif&quot;, &quot;.htm&quot; =&gt; &quot;text/html&quot;, &quot;.html&quot; =&gt; &quot;text/html&quot;, &quot;.jpeg&quot; =&gt; &quot;image/jpeg&quot;, &quot;.jpg&quot; =&gt; &quot;image/jpeg&quot;, &quot;.js&quot; =&gt; &quot;text/javascript&quot;, &quot;.png&quot; =&gt; &quot;image/png&quot;, &quot;.swf&quot; =&gt; &quot;application/x-shockwave-flash&quot;, &quot;.txt&quot; =&gt; &quot;text/plain&quot;</td> + <td class="context-item-value">YAML.load_file(File.join(File.dirname(__FILE__), MIME_TYPES_FILE))</td> </tr> <tr class="top-aligned-row context-row"> <td class="context-item-name">ONLY_HEAD_GET</td> <td>=</td> <td class="context-item-value">&quot;Only HEAD and GET allowed.&quot;.freeze</td> @@ -151,19 +156,14 @@ <div class="name-list"> <table> <tr class="top-aligned-row context-row"> <td class="context-item-name">default_content_type</td> - <td class="context-item-value">&nbsp;[R]&nbsp;</td> + <td class="context-item-value">&nbsp;[RW]&nbsp;</td> <td class="context-item-desc"></td> </tr> <tr class="top-aligned-row context-row"> - <td class="context-item-name">default_content_type</td> - <td class="context-item-value">&nbsp;[W]&nbsp;</td> - <td class="context-item-desc"></td> - </tr> - <tr class="top-aligned-row context-row"> <td class="context-item-name">path</td> <td class="context-item-value">&nbsp;[R]&nbsp;</td> <td class="context-item-desc"></td> </tr> </table> @@ -174,34 +174,34 @@ <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> - <div id="method-M000054" class="method-detail"> - <a name="M000054"></a> + <div id="method-M000056" class="method-detail"> + <a name="M000056"></a> <div class="method-heading"> - <a href="DirHandler.src/M000054.html" target="Code" class="method-signature" - onclick="popupCode('DirHandler.src/M000054.html');return false;"> + <a href="DirHandler.src/M000056.html" target="Code" class="method-signature" + onclick="popupCode('DirHandler.src/M000056.html');return false;"> <span class="method-name">add_mime_type</span><span class="method-args">(extension, type)</span> </a> </div> <div class="method-description"> <p> There is a small number of default mime types for extensions, but this lets -you add any others you&#8217;ll need when serving content. +you add any others you&#8216;ll need when serving content. </p> </div> </div> - <div id="method-M000049" class="method-detail"> - <a name="M000049"></a> + <div id="method-M000051" class="method-detail"> + <a name="M000051"></a> <div class="method-heading"> - <a href="DirHandler.src/M000049.html" target="Code" class="method-signature" - onclick="popupCode('DirHandler.src/M000049.html');return false;"> + <a href="DirHandler.src/M000051.html" target="Code" class="method-signature" + onclick="popupCode('DirHandler.src/M000051.html');return false;"> <span class="method-name">new</span><span class="method-args">(path, listing_allowed=true, index_html=&quot;index.html&quot;)</span> </a> </div> <div class="method-description"> @@ -211,16 +211,16 @@ </div> </div> <h3 class="section-bar">Public Instance methods</h3> - <div id="method-M000050" class="method-detail"> - <a name="M000050"></a> + <div id="method-M000052" class="method-detail"> + <a name="M000052"></a> <div class="method-heading"> - <a href="DirHandler.src/M000050.html" target="Code" class="method-signature" - onclick="popupCode('DirHandler.src/M000050.html');return false;"> + <a href="DirHandler.src/M000052.html" target="Code" class="method-signature" + onclick="popupCode('DirHandler.src/M000052.html');return false;"> <span class="method-name">can_serve</span><span class="method-args">(path_info)</span> </a> </div> <div class="method-description"> @@ -229,16 +229,16 @@ not). </p> </div> </div> - <div id="method-M000053" class="method-detail"> - <a name="M000053"></a> + <div id="method-M000055" class="method-detail"> + <a name="M000055"></a> <div class="method-heading"> - <a href="DirHandler.src/M000053.html" target="Code" class="method-signature" - onclick="popupCode('DirHandler.src/M000053.html');return false;"> + <a href="DirHandler.src/M000055.html" target="Code" class="method-signature" + onclick="popupCode('DirHandler.src/M000055.html');return false;"> <span class="method-name">process</span><span class="method-args">(request, response)</span> </a> </div> <div class="method-description"> @@ -247,44 +247,44 @@ allowed (based on the listing_allowed parameter to the constructor). </p> </div> </div> - <div id="method-M000051" class="method-detail"> - <a name="M000051"></a> + <div id="method-M000053" class="method-detail"> + <a name="M000053"></a> <div class="method-heading"> - <a href="DirHandler.src/M000051.html" target="Code" class="method-signature" - onclick="popupCode('DirHandler.src/M000051.html');return false;"> + <a href="DirHandler.src/M000053.html" target="Code" class="method-signature" + onclick="popupCode('DirHandler.src/M000053.html');return false;"> <span class="method-name">send_dir_listing</span><span class="method-args">(base, dir, response)</span> </a> </div> <div class="method-description"> <p> -Returns a simplistic directory listing if they&#8217;re enabled, otherwise +Returns a simplistic directory listing if they&#8216;re enabled, otherwise a 403. Base is the base URI from the REQUEST_URI, dir is the directory to serve on the file system (comes from <a -href="DirHandler.html#M000050">can_serve</a>()), and response is the <a +href="DirHandler.html#M000052">can_serve</a>()), and response is the <a href="HttpResponse.html">HttpResponse</a> object to send the results on. </p> </div> </div> - <div id="method-M000052" class="method-detail"> - <a name="M000052"></a> + <div id="method-M000054" class="method-detail"> + <a name="M000054"></a> <div class="method-heading"> - <a href="DirHandler.src/M000052.html" target="Code" class="method-signature" - onclick="popupCode('DirHandler.src/M000052.html');return false;"> + <a href="DirHandler.src/M000054.html" target="Code" class="method-signature" + onclick="popupCode('DirHandler.src/M000054.html');return false;"> <span class="method-name">send_file</span><span class="method-args">(req_path, request, response, header_only=false)</span> </a> </div> <div class="method-description"> <p> Sends the contents of a file back to the user. Not terribly efficient since -it&#8217;s opening and closing the file for each read. +it&#8216;s opening and closing the file for each read. </p> </div> </div> \ No newline at end of file