mod_deflate: Add Vary header, reset content-length header
This commit is contained in:
parent
c73bb4cd85
commit
241d0e48de
|
@ -28,11 +28,16 @@ LI_API void li_http_headers_free(liHttpHeaders* headers);
|
|||
|
||||
/** If header does not exist, just insert normal header. If it exists, append (", %s", value) */
|
||||
LI_API void li_http_header_append(liHttpHeaders *headers, const gchar *key, size_t keylen, const gchar *val, size_t valuelen);
|
||||
/** If header does not exist, just insert normal header. If it exists, add new entry to list ("%s: %s", key, value) */
|
||||
|
||||
/** Add new entry to list ("%s: %s", key, value) */
|
||||
LI_API void li_http_header_insert(liHttpHeaders *headers, const gchar *key, size_t keylen, const gchar *val, size_t valuelen);
|
||||
|
||||
/** If header does not exist, just insert normal header. If it exists, overwrite the value */
|
||||
LI_API void li_http_header_overwrite(liHttpHeaders *headers, const gchar *key, size_t keylen, const gchar *val, size_t valuelen);
|
||||
|
||||
/** Remove all header entries with specified key */
|
||||
LI_API gboolean li_http_header_remove(liHttpHeaders *headers, const gchar *key, size_t keylen);
|
||||
|
||||
LI_API void li_http_header_remove_link(liHttpHeaders *headers, GList *l);
|
||||
|
||||
LI_API liHttpHeader* li_http_header_lookup(liHttpHeaders *headers, const gchar *key, size_t keylen);
|
||||
|
|
|
@ -517,7 +517,9 @@ static liHandlerResult deflate_handle(liVRequest *vr, gpointer param, gpointer *
|
|||
return LI_HANDLER_GO_ON;
|
||||
}
|
||||
|
||||
li_http_header_append(vr->response.headers, CONST_STR_LEN("Content-Encoding"), encoding_names[i], strlen(encoding_names[i]));
|
||||
li_http_header_insert(vr->response.headers, CONST_STR_LEN("Content-Encoding"), encoding_names[i], strlen(encoding_names[i]));
|
||||
li_http_header_append(vr->response.headers, CONST_STR_LEN("Vary"), CONST_STR_LEN("Accept-Encoding"));
|
||||
li_http_header_remove(vr->response.headers, CONST_STR_LEN("content-length"));
|
||||
if (hh_etag) {
|
||||
GString *s = vr->wrk->tmp_str;
|
||||
g_string_truncate(s, 0);
|
||||
|
|
Loading…
Reference in New Issue