2 LuCI http protocol implementation - HTTP/1.1 bits.
4 This class provides basic ETag handling and implements most of the
5 conditional HTTP/1.1 headers specified in RFC2616 Sct. 14.24 - 14.28 .
7 module "luci.http.conditionals"
10 Implement 14.19 / ETag.
14 @param stat A file.stat structure
15 @return String containing the generated tag suitable for ETag headers
21 Test whether the given message object contains an "If-Match" header and
22 compare it against the given stat object.
25 @param req HTTP request message object
26 @param stat A file.stat object
27 @return Boolean indicating whether the precondition is ok
28 @return Alternative status code if the precondition failed
32 14.25 / If-Modified-Since
34 Test whether the given message object contains an "If-Modified-Since" header
35 and compare it against the given stat object.
37 @name if_modified_since
38 @param req HTTP request message object
39 @param stat A file.stat object
40 @return Boolean indicating whether the precondition is ok
41 @return Alternative status code if the precondition failed
42 @return Table containing extra HTTP headers if the precondition failed
48 Test whether the given message object contains an "If-None-Match" header and
49 compare it against the given stat object.
52 @param req HTTP request message object
53 @param stat A file.stat object
54 @return Boolean indicating whether the precondition is ok
55 @return Alternative status code if the precondition failed
56 @return Table containing extra HTTP headers if the precondition failed
62 The If-Range header is currently not implemented due to the lack of general
63 byte range stuff in luci.http.protocol . This function will always return
64 false, 412 to indicate a failed precondition.
67 @param req HTTP request message object
68 @param stat A file.stat object
69 @return Boolean indicating whether the precondition is ok
70 @return Alternative status code if the precondition failed
74 14.28 / If-Unmodified-Since
76 Test whether the given message object contains an "If-Unmodified-Since"
77 header and compare it against the given stat object.
79 @name if_unmodified_since
80 @param req HTTP request message object
81 @param stat A file.stat object
82 @return Boolean indicating whether the precondition is ok
83 @return Alternative status code if the precondition failed