1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <title>Reference</title>
6 <link rel="stylesheet" href="../luadoc.css" type="text/css" />
7 <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
14 <div id="product_logo"></div>
15 <div id="product_name"><big><b></b></big></div>
16 <div id="product_description"></div>
17 </div> <!-- id="product" -->
27 <li><a href="../index.html">Index</a></li>
38 <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
42 <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
45 <li><strong>luci.http.protocol.conditionals</strong></li>
48 <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
52 <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
56 <a href="../modules/luci.i18n.html">luci.i18n</a>
60 <a href="../modules/luci.ip.html">luci.ip</a>
64 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
68 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
72 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
76 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
80 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
84 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
88 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
92 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
96 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
100 <a href="../modules/nixio.html">nixio</a>
104 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
108 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
112 <a href="../modules/nixio.File.html">nixio.File</a>
116 <a href="../modules/nixio.README.html">nixio.README</a>
120 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
124 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
128 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
132 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
136 <a href="../modules/nixio.bin.html">nixio.bin</a>
140 <a href="../modules/nixio.bit.html">nixio.bit</a>
144 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
148 <a href="../modules/nixio.fs.html">nixio.fs</a>
163 </div><!-- id="navigation" -->
167 <h1>Class <code>luci.http.protocol.conditionals</code></h1>
178 <table class="function_list">
181 <td class="name" nowrap><a href="#if_match">if_match</a> (req, stat)</td>
186 Test whether the given message object contains an "If-Match" header and
187 compare it against the given stat object.</td>
191 <td class="name" nowrap><a href="#if_modified_since">if_modified_since</a> (req, stat)</td>
194 14.25 / If-Modified-Since
196 Test whether the given message object contains an "If-Modified-Since" header
197 and compare it against the given stat object.</td>
201 <td class="name" nowrap><a href="#if_none_match">if_none_match</a> (req, stat)</td>
204 14.26 / If-None-Match
206 Test whether the given message object contains an "If-None-Match" header and
207 compare it against the given stat object.</td>
211 <td class="name" nowrap><a href="#if_range">if_range</a> (req, stat)</td>
216 The If-Range header is currently not implemented due to the lack of general
217 byte range stuff in luci.http.protocol .</td>
221 <td class="name" nowrap><a href="#if_unmodified_since">if_unmodified_since</a> (req, stat)</td>
224 14.28 / If-Unmodified-Since
226 Test whether the given message object contains an "If-Unmodified-Since"
227 header and compare it against the given stat object.</td>
231 <td class="name" nowrap><a href="#mk_etag">mk_etag</a> (stat)</td>
234 Implement 14.19 / ETag.</td>
248 <h2><a name="functions"></a>Functions</h2>
249 <dl class="function">
253 <dt><a name="if_match"></a><strong>if_match</strong> (req, stat)</dt>
259 Test whether the given message object contains an "If-Match" header and
260 compare it against the given stat object.
267 req: HTTP request message object
271 stat: A file.stat object
281 <h3>Return values:</h3>
284 <li>Boolean indicating whether the precondition is ok
286 <li>Alternative status code if the precondition failed
297 <dt><a name="if_modified_since"></a><strong>if_modified_since</strong> (req, stat)</dt>
301 14.25 / If-Modified-Since
303 Test whether the given message object contains an "If-Modified-Since" header
304 and compare it against the given stat object.
311 req: HTTP request message object
315 stat: A file.stat object
325 <h3>Return values:</h3>
328 <li>Boolean indicating whether the precondition is ok
330 <li>Alternative status code if the precondition failed
332 <li>Table containing extra HTTP headers if the precondition failed
343 <dt><a name="if_none_match"></a><strong>if_none_match</strong> (req, stat)</dt>
347 14.26 / If-None-Match
349 Test whether the given message object contains an "If-None-Match" header and
350 compare it against the given stat object.
357 req: HTTP request message object
361 stat: A file.stat object
371 <h3>Return values:</h3>
374 <li>Boolean indicating whether the precondition is ok
376 <li>Alternative status code if the precondition failed
378 <li>Table containing extra HTTP headers if the precondition failed
389 <dt><a name="if_range"></a><strong>if_range</strong> (req, stat)</dt>
395 The If-Range header is currently not implemented due to the lack of general
396 byte range stuff in luci.http.protocol . This function will always return
397 false, 412 to indicate a failed precondition.
404 req: HTTP request message object
408 stat: A file.stat object
418 <h3>Return values:</h3>
421 <li>Boolean indicating whether the precondition is ok
423 <li>Alternative status code if the precondition failed
434 <dt><a name="if_unmodified_since"></a><strong>if_unmodified_since</strong> (req, stat)</dt>
438 14.28 / If-Unmodified-Since
440 Test whether the given message object contains an "If-Unmodified-Since"
441 header and compare it against the given stat object.
448 req: HTTP request message object
452 stat: A file.stat object
462 <h3>Return values:</h3>
465 <li>Boolean indicating whether the precondition is ok
467 <li>Alternative status code if the precondition failed
478 <dt><a name="mk_etag"></a><strong>mk_etag</strong> (stat)</dt>
482 Implement 14.19 / ETag.
490 stat: A file.stat structure
500 <h3>Return value:</h3>
501 String containing the generated tag suitable for ETag headers
514 </div> <!-- id="content" -->
516 </div> <!-- id="main" -->
519 <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
520 </div> <!-- id="about" -->
522 </div> <!-- id="container" -->