summaryrefslogtreecommitdiff
path: root/include/http_protocol.h
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2013-05-07 13:42:31 +0000
committerGraham Leggett <minfrin@apache.org>2013-05-07 13:42:31 +0000
commit6194962c469fa961b396e5d11d77e41a225013f7 (patch)
tree88bc246be11d68f42a5cca66548aeecdc64234e5 /include/http_protocol.h
parent56d0b5d13d8aed3331a16f222510295e0e6ae274 (diff)
downloadhttpd-6194962c469fa961b396e5d11d77e41a225013f7.tar.gz
core, mod_cache: Ensure RFC2616 compliance in ap_meets_conditions()
with weak validation combined with If-Range and Range headers. Break out explicit conditional header checks to be useable elsewhere in the server. Ensure weak validation RFC compliance in the byteranges filter. Ensure RFC validation compliance when serving cached entities. PR 16142 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479905 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_protocol.h')
-rw-r--r--include/http_protocol.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/include/http_protocol.h b/include/http_protocol.h
index cd1942e56c..415270b2ad 100644
--- a/include/http_protocol.h
+++ b/include/http_protocol.h
@@ -167,6 +167,72 @@ AP_DECLARE(void) ap_set_etag(request_rec *r);
*/
AP_DECLARE(void) ap_set_last_modified(request_rec *r);
+typedef enum {
+ AP_CONDITION_NONE,
+ AP_CONDITION_NOMATCH,
+ AP_CONDITION_WEAK,
+ AP_CONDITION_STRONG
+} ap_condition_e;
+
+/**
+ * Tests conditional request rules for the If-Match header.
+ * @param r The current request
+ * @param headers The response headers to check against
+ * @return AP_CONDITION_NONE if the header is missing, AP_CONDITION_NOMATCH
+ * if the header does not match, AP_CONDITION_STRONG for a strong
+ * match. Weak matches are not permitted for the If-Match header.
+ */
+AP_DECLARE(ap_condition_e) ap_condition_if_match(request_rec *r,
+ apr_table_t *headers);
+
+/**
+ * Tests conditional request rules for the If-Unmodified-Since header.
+ * @param r The current request
+ * @param headers The response headers to check against
+ * @return AP_CONDITION_NONE if the header is missing, AP_CONDITION_NOMATCH
+ * if the header does not match, AP_CONDITION_WEAK if a weak match
+ * was present and allowed by RFC2616, AP_CONDITION_STRONG for a
+ * strong match.
+ */
+AP_DECLARE(ap_condition_e) ap_condition_if_unmodified_since(request_rec *r,
+ apr_table_t *headers);
+
+/**
+ * Tests conditional request rules for the If-None-Match header.
+ * @param r The current request
+ * @param headers The response headers to check against
+ * @return AP_CONDITION_NONE if the header is missing, AP_CONDITION_NOMATCH
+ * if the header does not match, AP_CONDITION_WEAK if a weak match
+ * was present and allowed by RFC2616, AP_CONDITION_STRONG for a
+ * strong match.
+ */
+AP_DECLARE(ap_condition_e) ap_condition_if_none_match(request_rec *r,
+ apr_table_t *headers);
+
+/**
+ * Tests conditional request rules for the If-Modified-Since header.
+ * @param r The current request
+ * @param headers The response headers to check against
+ * @return AP_CONDITION_NONE if the header is missing, AP_CONDITION_NOMATCH
+ * if the header does not match, AP_CONDITION_WEAK if a weak match
+ * was present and allowed by RFC2616, AP_CONDITION_STRONG for a
+ * strong match.
+ */
+AP_DECLARE(ap_condition_e) ap_condition_if_modified_since(request_rec *r,
+ apr_table_t *headers);
+
+/**
+ * Tests conditional request rules for the If-Range header.
+ * @param r The current request
+ * @param headers The response headers to check against
+ * @return AP_CONDITION_NONE if either the If-Range or Range header is
+ * missing, AP_CONDITION_NOMATCH if the header does not match,
+ * AP_CONDITION_STRONG for a strong match. Weak matches are not
+ * permitted for the If-Range header.
+ */
+AP_DECLARE(ap_condition_e) ap_condition_if_range(request_rec *r,
+ apr_table_t *headers);
+
/**
* Implements condition GET rules for HTTP/1.1 specification. This function
* inspects the client headers and determines if the response fulfills