From: Stefan Eissing Date: Fri, 26 Feb 2016 15:56:20 +0000 (+0000) Subject: adding accep,accept-encoding headers from initiating request to push promises X-Git-Tag: 2.5.0-alpha~2004 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b65f9f1e49361271a1535201dd4625cb7e370a53;p=thirdparty%2Fapache%2Fhttpd.git adding accep,accept-encoding headers from initiating request to push promises git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1732507 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_push.c b/modules/http2/h2_push.c index 82615afdbbb..c0325ff4191 100644 --- a/modules/http2/h2_push.c +++ b/modules/http2/h2_push.c @@ -276,9 +276,16 @@ static int same_authority(const h2_request *req, const apr_uri_t *uri) return 1; } -static int set_header(void *ctx, const char *key, const char *value) +static int set_push_header(void *ctx, const char *key, const char *value) { - apr_table_setn(ctx, key, value); + size_t klen = strlen(key); + if (H2_HD_MATCH_LIT("User-Agent", key, klen) + || H2_HD_MATCH_LIT("Accept", key, klen) + || H2_HD_MATCH_LIT("Accept-Encoding", key, klen) + || H2_HD_MATCH_LIT("Accept-Language", key, klen) + || H2_HD_MATCH_LIT("Cache-Control", key, klen)) { + apr_table_setn(ctx, key, value); + } return 1; } @@ -338,11 +345,7 @@ static int add_push(link_ctx *ctx) break; } headers = apr_table_make(ctx->pool, 5); - apr_table_do(set_header, headers, ctx->req->headers, - "User-Agent", - "Cache-Control", - "Accept-Language", - NULL); + apr_table_do(set_push_header, headers, ctx->req->headers, NULL); req = h2_request_createn(0, ctx->pool, method, ctx->req->scheme, ctx->req->authority, path, headers, ctx->req->serialize);