Server IP : 66.29.132.122 / Your IP : 18.117.158.203 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/proc/self/root/proc/thread-self/root/proc/self/root/proc/self/root/opt/alt/ruby18/lib64/ruby/gems/1.8/doc/rack-1.6.1/rdoc/classes/Rack/ShowStatus.src/ |
Upload File : |
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>call (Rack::ShowStatus)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File lib/rack/showstatus.rb, line 19</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) <span class="ruby-identifier">status</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">body</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) <span class="ruby-identifier">headers</span> = <span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">HeaderHash</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">headers</span>) <span class="ruby-identifier">empty</span> = <span class="ruby-identifier">headers</span>[<span class="ruby-constant">CONTENT_LENGTH</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span> <span class="ruby-comment cmt"># client or server error, or explicit message</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">status</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">>=</span> <span class="ruby-value">400</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">empty</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-value str">"rack.showstatus.detail"</span>] <span class="ruby-comment cmt"># This double assignment is to prevent an "unused variable" warning on</span> <span class="ruby-comment cmt"># Ruby 1.9.3. Yes, it is dumb, but I don't like Ruby yelling at me.</span> <span class="ruby-identifier">req</span> = <span class="ruby-identifier">req</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>) <span class="ruby-identifier">message</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_STATUS_CODES</span>[<span class="ruby-identifier">status</span>.<span class="ruby-identifier">to_i</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-comment cmt"># This double assignment is to prevent an "unused variable" warning on</span> <span class="ruby-comment cmt"># Ruby 1.9.3. Yes, it is dumb, but I don't like Ruby yelling at me.</span> <span class="ruby-identifier">detail</span> = <span class="ruby-identifier">detail</span> = <span class="ruby-identifier">env</span>[<span class="ruby-value str">"rack.showstatus.detail"</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">message</span> <span class="ruby-identifier">body</span> = <span class="ruby-ivar">@template</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>) <span class="ruby-identifier">size</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span>.<span class="ruby-identifier">bytesize</span>(<span class="ruby-identifier">body</span>) [<span class="ruby-identifier">status</span>, <span class="ruby-identifier">headers</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-constant">CONTENT_TYPE</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"text/html"</span>, <span class="ruby-constant">CONTENT_LENGTH</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span>), [<span class="ruby-identifier">body</span>]] <span class="ruby-keyword kw">else</span> [<span class="ruby-identifier">status</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">body</span>] <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>