Match request Accept-Encoding with response Content-Encoding. First determine if the cached document has identity encoding. This can be the case if the document has no Content-Encoding header field or if the Content-Encoding field explicitly lists "identity". Then, if there is no Accept-Encoding header and the cached response uses identity encoding return a match. If there is no Accept-
| 806 | |
| 807 | */ |
| 808 | static inline bool |
| 809 | does_encoding_match(char *enc1, const char *enc2) |
| 810 | { |
| 811 | if (is_asterisk(enc1) || ((strcasecmp(enc1, enc2)) == 0)) { |
| 812 | return true; |
| 813 | } |
| 814 | |
| 815 | // rfc2616,sec3.5: applications SHOULD consider "x-gzip" and "x-compress" to be |
| 816 | // equivalent to "gzip" and "compress" respectively |
| 817 | if ((!strcasecmp(enc1, "gzip") && !strcasecmp(enc2, "x-gzip")) || (!strcasecmp(enc1, "x-gzip") && !strcasecmp(enc2, "gzip")) || |
| 818 | (!strcasecmp(enc1, "compress") && !strcasecmp(enc2, "x-compress")) || |
| 819 | (!strcasecmp(enc1, "x-compress") && !strcasecmp(enc2, "compress"))) { |
| 820 | return true; |
| 821 | } |
| 822 | |
| 823 | return false; |
| 824 | } |
| 825 | |
| 826 | bool |
| 827 | HttpTransactCache::match_content_encoding(MIMEField *accept_field, const char *encoding_identifier) |
no test coverage detected