summaryrefslogtreecommitdiff
path: root/src/h2.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2022-04-17 20:40:48 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2022-05-05 13:35:18 -0400
commit1ed3a78ea9f51c33c348de6aaa02447d3ac54fae (patch)
tree3267fe7d76b46bfd20b7f52b1eae1b8e17709e17 /src/h2.c
parent59b9a9a73d1d47c72483e040b8a45dcdac05f4cd (diff)
downloadlighttpd-git-1ed3a78ea9f51c33c348de6aaa02447d3ac54fae.tar.gz
[core] send Priority resp hdr w/ .css, .js re-prio
send Priority response header with .css, .js re-prioriziation
Diffstat (limited to 'src/h2.c')
-rw-r--r--src/h2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/h2.c b/src/h2.c
index 7bc580b5..53da2b53 100644
--- a/src/h2.c
+++ b/src/h2.c
@@ -1632,8 +1632,12 @@ h2_recv_headers (connection * const con, uint8_t * const s, uint32_t flen)
/*(bump .js and .css to urgency 2; see h2_init_stream())*/
const uint32_t len = buffer_clen(&r->target);
const char * const p = r->target.ptr+len-4;
- if (len>=4 && (0==memcmp(p+1,".js",3) || 0==memcmp(p,".css",4)))
+ if (len>=4 && (0==memcmp(p+1,".js",3)||0==memcmp(p,".css",4))) {
r->h2_prio = (2 << 1) | !0; /*(urgency=2, incremental=0)*/
+ http_header_response_set(r, HTTP_HEADER_PRIORITY,
+ CONST_STR_LEN("priority"),
+ CONST_STR_LEN("u=2"));
+ }
}
}
if (h2c->rused-1) /*(true if more than one active stream)*/