$67 GRAYBYTE WORDPRESS FILE MANAGER $81

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.36
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby18/lib64/ruby/gems/1.8/doc/rack-1.6.1/rdoc/files/lib/rack/

HOME
Current File : /opt/alt/ruby18/lib64/ruby/gems/1.8/doc/rack-1.6.1/rdoc/files/lib/rack//utils_rb.html
<?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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>File: utils.rb</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



  <div id="fileHeader">
    <h1>utils.rb</h1>
    <table class="header-table">
    <tr class="top-aligned-row">
      <td><strong>Path:</strong></td>
      <td>lib/rack/utils.rb
      </td>
    </tr>
    <tr class="top-aligned-row">
      <td><strong>Last Update:</strong></td>
      <td>Thu Dec 05 17:13:57 -0500 2019</td>
    </tr>
    </table>
  </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">


    <div id="requires-list">
      <h3 class="section-bar">Required files</h3>

      <div class="name-list">
      fileutils&nbsp;&nbsp;
      set&nbsp;&nbsp;
      tempfile&nbsp;&nbsp;
      rack/multipart&nbsp;&nbsp;
      time&nbsp;&nbsp;
      rack/backports/uri/common_18&nbsp;&nbsp;
      rack/backports/uri/common_192&nbsp;&nbsp;
      rack/backports/uri/common_193&nbsp;&nbsp;
      uri/common&nbsp;&nbsp;
      </div>
    </div>

   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000006">best_q_match</a>&nbsp;&nbsp;
      <a href="#M000004">build_nested_query</a>&nbsp;&nbsp;
      <a href="#M000003">build_query</a>&nbsp;&nbsp;
      <a href="#M000015">byte_ranges</a>&nbsp;&nbsp;
      <a href="#M000012">bytesize</a>&nbsp;&nbsp;
      <a href="#M000011">bytesize</a>&nbsp;&nbsp;
      <a href="#M000018">clean_path_info</a>&nbsp;&nbsp;
      <a href="#M000010">delete_cookie_header!</a>&nbsp;&nbsp;
      <a href="#M000007">escape_html</a>&nbsp;&nbsp;
      <a href="#M000001">normalize_params</a>&nbsp;&nbsp;
      <a href="#M000002">params_hash_type?</a>&nbsp;&nbsp;
      <a href="#M000005">q_values</a>&nbsp;&nbsp;
      <a href="#M000014">rfc2109</a>&nbsp;&nbsp;
      <a href="#M000013">rfc2822</a>&nbsp;&nbsp;
      <a href="#M000016">secure_compare</a>&nbsp;&nbsp;
      <a href="#M000008">select_best_encoding</a>&nbsp;&nbsp;
      <a href="#M000009">set_cookie_header!</a>&nbsp;&nbsp;
      <a href="#M000017">status_code</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <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">ESCAPE_HTML</td>
          <td>=</td>
          <td class="context-item-value">{       &quot;&amp;&quot; =&gt; &quot;&amp;amp;&quot;,       &quot;&lt;&quot; =&gt; &quot;&amp;lt;&quot;,       &quot;&gt;&quot; =&gt; &quot;&amp;gt;&quot;,       &quot;'&quot; =&gt; &quot;&amp;#x27;&quot;,       '&quot;' =&gt; &quot;&amp;quot;&quot;,       &quot;/&quot; =&gt; &quot;&amp;#x2F;&quot;</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">ESCAPE_HTML_PATTERN</td>
          <td>=</td>
          <td class="context-item-value">Regexp.union(*ESCAPE_HTML.keys)</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">ESCAPE_HTML_PATTERN</td>
          <td>=</td>
          <td class="context-item-value">/#{Regexp.union(*ESCAPE_HTML.keys)}/n</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
On 1.8, there is a kcode = &#8216;u&#8217; bug that allows for XSS
otherwise TODO doesn&#8216;t apply to jruby, so a better condition above
might be preferable?

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">HTTP_STATUS_CODES</td>
          <td>=</td>
          <td class="context-item-value">{       100 =&gt; 'Continue',       101 =&gt; 'Switching Protocols',       102 =&gt; 'Processing',       200 =&gt; 'OK',       201 =&gt; 'Created',       202 =&gt; 'Accepted',       203 =&gt; 'Non-Authoritative Information',       204 =&gt; 'No Content',       205 =&gt; 'Reset Content',       206 =&gt; 'Partial Content',       207 =&gt; 'Multi-Status',       208 =&gt; 'Already Reported',       226 =&gt; 'IM Used',       300 =&gt; 'Multiple Choices',       301 =&gt; 'Moved Permanently',       302 =&gt; 'Found',       303 =&gt; 'See Other',       304 =&gt; 'Not Modified',       305 =&gt; 'Use Proxy',       307 =&gt; 'Temporary Redirect',       308 =&gt; 'Permanent Redirect',       400 =&gt; 'Bad Request',       401 =&gt; 'Unauthorized',       402 =&gt; 'Payment Required',       403 =&gt; 'Forbidden',       404 =&gt; 'Not Found',       405 =&gt; 'Method Not Allowed',       406 =&gt; 'Not Acceptable',       407 =&gt; 'Proxy Authentication Required',       408 =&gt; 'Request Timeout',       409 =&gt; 'Conflict',       410 =&gt; 'Gone',       411 =&gt; 'Length Required',       412 =&gt; 'Precondition Failed',       413 =&gt; 'Payload Too Large',       414 =&gt; 'URI Too Long',       415 =&gt; 'Unsupported Media Type',       416 =&gt; 'Range Not Satisfiable',       417 =&gt; 'Expectation Failed',       422 =&gt; 'Unprocessable Entity',       423 =&gt; 'Locked',       424 =&gt; 'Failed Dependency',       426 =&gt; 'Upgrade Required',       428 =&gt; 'Precondition Required',       429 =&gt; 'Too Many Requests',       431 =&gt; 'Request Header Fields Too Large',       500 =&gt; 'Internal Server Error',       501 =&gt; 'Not Implemented',       502 =&gt; 'Bad Gateway',       503 =&gt; 'Service Unavailable',       504 =&gt; 'Gateway Timeout',       505 =&gt; 'HTTP Version Not Supported',       506 =&gt; 'Variant Also Negotiates',       507 =&gt; 'Insufficient Storage',       508 =&gt; 'Loop Detected',       510 =&gt; 'Not Extended',       511 =&gt; 'Network Authentication Required'</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
Every standard HTTP code mapped to the appropriate message. Generated with:
curl -s <a
href="https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv">www.iana.org/assignments/http-status-codes/http-status-codes-1.csv</a>
| # ruby -ne &#8216;m =
/^(\d{3}),(?!Unassigned|\(Unused\))([^,]+)/.match($_) and # puts
&quot;#{m[1]} =&gt; \x27#{m[2].strip}\x27,&quot;&#8217;

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">STATUS_WITH_NO_ENTITY_BODY</td>
          <td>=</td>
          <td class="context-item-value">Set.new((100..199).to_a &lt;&lt; 204 &lt;&lt; 205 &lt;&lt; 304)</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
Responses with HTTP status codes that should not have an entity body

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">SYMBOL_TO_STATUS_CODE</td>
          <td>=</td>
          <td class="context-item-value">Hash[*HTTP_STATUS_CODES.map { |code, message|       [message.downcase.gsub(/\s|-|'/, '_').to_sym, code]</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Multipart</td>
          <td>=</td>
          <td class="context-item-value">Rack::Multipart</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">PATH_SEPS</td>
          <td>=</td>
          <td class="context-item-value">Regexp.union(*[::File::SEPARATOR, ::File::ALT_SEPARATOR].compact)</td>
        </tr>
        </table>
      </div>
    </div>



      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000006" class="method-detail">
        <a name="M000006"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000006.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000006.html');return false;">
          <span class="method-name">best_q_match</span><span class="method-args">(q_value_header, available_mimes)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000004" class="method-detail">
        <a name="M000004"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000004.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000004.html');return false;">
          <span class="method-name">build_nested_query</span><span class="method-args">(value, prefix = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000003" class="method-detail">
        <a name="M000003"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000003.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000003.html');return false;">
          <span class="method-name">build_query</span><span class="method-args">(params)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000015" class="method-detail">
        <a name="M000015"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000015.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000015.html');return false;">
          <span class="method-name">byte_ranges</span><span class="method-args">(env, size)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Parses the &quot;Range:&quot; header, if present, into an array of Range
objects. Returns nil if the header is missing or syntactically invalid.
Returns an empty array if none of the ranges are satisfiable.
</p>
        </div>
      </div>

      <div id="method-M000012" class="method-detail">
        <a name="M000012"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000012.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000012.html');return false;">
          <span class="method-name">bytesize</span><span class="method-args">(string)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000011" class="method-detail">
        <a name="M000011"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000011.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000011.html');return false;">
          <span class="method-name">bytesize</span><span class="method-args">(string)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000018" class="method-detail">
        <a name="M000018"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000018.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000018.html');return false;">
          <span class="method-name">clean_path_info</span><span class="method-args">(path_info)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000010" class="method-detail">
        <a name="M000010"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000010.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000010.html');return false;">
          <span class="method-name">delete_cookie_header!</span><span class="method-args">(header, key, value = {})</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000007" class="method-detail">
        <a name="M000007"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000007.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000007.html');return false;">
          <span class="method-name">escape_html</span><span class="method-args">(string)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Escape ampersands, brackets and quotes to their HTML/XML entities.
</p>
        </div>
      </div>

      <div id="method-M000001" class="method-detail">
        <a name="M000001"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000001.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000001.html');return false;">
          <span class="method-name">normalize_params</span><span class="method-args">(params, name, v = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
<a href="utils_rb.html#M000001">normalize_params</a> recursively expands
parameters into structural types. If the structural types represented by
two different parameter names are in conflict, a ParameterTypeError is
raised.
</p>
        </div>
      </div>

      <div id="method-M000002" class="method-detail">
        <a name="M000002"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000002.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000002.html');return false;">
          <span class="method-name">params_hash_type?</span><span class="method-args">(obj)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000005" class="method-detail">
        <a name="M000005"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000005.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000005.html');return false;">
          <span class="method-name">q_values</span><span class="method-args">(q_value_header)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000014" class="method-detail">
        <a name="M000014"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000014.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000014.html');return false;">
          <span class="method-name">rfc2109</span><span class="method-args">(time)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Modified version of stdlib time.rb Time#rfc2822 to use
&#8217;%d-%b-%Y&#8217; instead of &#8217;% %b %Y&#8217;. It assumes that
the time is in GMT to comply to the RFC 2109.
</p>
<p>
NOTE: I&#8216;m not sure the RFC says it requires GMT, but is ambiguous
enough that I&#8216;m certain someone implemented only that option. Do not
use %a and %b from Time.strptime, it would use localized names for weekday
and month.
</p>
        </div>
      </div>

      <div id="method-M000013" class="method-detail">
        <a name="M000013"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000013.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000013.html');return false;">
          <span class="method-name">rfc2822</span><span class="method-args">(time)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000016" class="method-detail">
        <a name="M000016"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000016.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000016.html');return false;">
          <span class="method-name">secure_compare</span><span class="method-args">(a, b)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Constant time string comparison.
</p>
<p>
NOTE: the values compared should be of fixed length, such as strings that
have already been processed by HMAC. This should not be used on variable
length plaintext strings because it could leak length info via timing
attacks.
</p>
        </div>
      </div>

      <div id="method-M000008" class="method-detail">
        <a name="M000008"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000008.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000008.html');return false;">
          <span class="method-name">select_best_encoding</span><span class="method-args">(available_encodings, accept_encoding)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000009" class="method-detail">
        <a name="M000009"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000009.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000009.html');return false;">
          <span class="method-name">set_cookie_header!</span><span class="method-args">(header, key, value)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000017" class="method-detail">
        <a name="M000017"></a>

        <div class="method-heading">
          <a href="utils_rb.src/M000017.html" target="Code" class="method-signature"
            onclick="popupCode('utils_rb.src/M000017.html');return false;">
          <span class="method-name">status_code</span><span class="method-args">(status)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
1 Jan 1970 12.00 AM
root / root
0
auth
--
3 Mar 2024 10.50 PM
root / root
0755
backports
--
3 Mar 2024 10.50 PM
root / root
0755
handler
--
3 Mar 2024 10.50 PM
root / root
0755
multipart
--
3 Mar 2024 10.50 PM
root / root
0755
session
--
3 Mar 2024 10.50 PM
root / root
0755
utils
--
3 Mar 2024 10.50 PM
root / root
0755
utils_rb.src
--
3 Mar 2024 10.50 PM
root / root
0755
body_proxy_rb.html
1.963 KB
5 Dec 2019 10.14 PM
root / root
0644
builder_rb.html
1.954 KB
5 Dec 2019 10.14 PM
root / root
0644
cascade_rb.html
1.954 KB
5 Dec 2019 10.14 PM
root / root
0644
chunked_rb.html
2.113 KB
5 Dec 2019 10.14 PM
root / root
0644
commonlogger_rb.html
2.133 KB
5 Dec 2019 10.14 PM
root / root
0644
conditionalget_rb.html
2.134 KB
5 Dec 2019 10.14 PM
root / root
0644
config_rb.html
1.951 KB
5 Dec 2019 10.14 PM
root / root
0644
content_length_rb.html
2.167 KB
5 Dec 2019 10.14 PM
root / root
0644
content_type_rb.html
2.128 KB
5 Dec 2019 10.14 PM
root / root
0644
deflater_rb.html
2.161 KB
5 Dec 2019 10.14 PM
root / root
0644
directory_rb.html
2.169 KB
5 Dec 2019 10.14 PM
root / root
0644
etag_rb.html
2.104 KB
5 Dec 2019 10.14 PM
root / root
0644
file_rb.html
2.154 KB
5 Dec 2019 10.14 PM
root / root
0644
handler_rb.html
1.954 KB
5 Dec 2019 10.14 PM
root / root
0644
head_rb.html
2.109 KB
5 Dec 2019 10.14 PM
root / root
0644
lint_rb.html
2.134 KB
5 Dec 2019 10.14 PM
root / root
0644
lobster_rb.html
2.169 KB
5 Dec 2019 10.14 PM
root / root
0644
lock_rb.html
2.134 KB
5 Dec 2019 10.14 PM
root / root
0644
logger_rb.html
2.106 KB
5 Dec 2019 10.14 PM
root / root
0644
methodoverride_rb.html
1.975 KB
5 Dec 2019 10.14 PM
root / root
0644
mime_rb.html
1.945 KB
5 Dec 2019 10.14 PM
root / root
0644
mock_rb.html
2.233 KB
5 Dec 2019 10.14 PM
root / root
0644
multipart_rb.html
1.96 KB
5 Dec 2019 10.14 PM
root / root
0644
nulllogger_rb.html
1.963 KB
5 Dec 2019 10.14 PM
root / root
0644
recursive_rb.html
2.112 KB
5 Dec 2019 10.14 PM
root / root
0644
reloader_rb.html
2.427 KB
5 Dec 2019 10.14 PM
root / root
0644
request_rb.html
2.113 KB
5 Dec 2019 10.14 PM
root / root
0644
response_rb.html
2.202 KB
5 Dec 2019 10.14 PM
root / root
0644
rewindable_input_rb.html
2.166 KB
5 Dec 2019 10.14 PM
root / root
0644
runtime_rb.html
1.954 KB
5 Dec 2019 10.14 PM
root / root
0644
sendfile_rb.html
2.148 KB
5 Dec 2019 10.14 PM
root / root
0644
server_rb.html
2.129 KB
5 Dec 2019 10.14 PM
root / root
0644
showexceptions_rb.html
2.211 KB
5 Dec 2019 10.14 PM
root / root
0644
showstatus_rb.html
2.174 KB
5 Dec 2019 10.14 PM
root / root
0644
static_rb.html
1.951 KB
5 Dec 2019 10.14 PM
root / root
0644
tempfile_reaper_rb.html
2.142 KB
5 Dec 2019 10.14 PM
root / root
0644
urlmap_rb.html
1.951 KB
5 Dec 2019 10.14 PM
root / root
0644
utils_rb.html
18.612 KB
5 Dec 2019 10.14 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF