commit 9711a56ef7f3c9977ef6a188095f50d35db53ce3 from: kirill date: Sun May 10 10:02:04 2026 UTC usr.sbin/httpd: inherit gzip-static in locations Location configuration inherited most server level options but dropped gzip-static, so requests matching a location skipped static gzip lookup even when the parent server enabled it. Add an explicit no gzip-static state and inherit the gzip flag pair only when the location has not set either form, preserving location specific overrides. Reported by and OK: job@ commit - 9f799d905510b1fc86562dd95e2d31c02bf72ee8 commit + 9711a56ef7f3c9977ef6a188095f50d35db53ce3 blob - 52066ce7b283363df94bef7d142056d06cb6bffb blob + 78bfac7fdedee95ead1b839ad082fa8f350b7567 --- config.c +++ config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.69 2026/03/02 19:24:58 rsadowski Exp $ */ +/* $OpenBSD: config.c,v 1.70 2026/05/10 10:02:04 kirill Exp $ */ /* * Copyright (c) 2011 - 2015 Reyk Floeter @@ -563,6 +563,10 @@ config_getserver_config(struct httpd *env, struct serv if ((srv_conf->flags & f) == 0) srv_conf->flags |= parent->flags & f; + f = SRVFLAG_GZIP_STATIC|SRVFLAG_NO_GZIP_STATIC; + if ((srv_conf->flags & f) == 0) + srv_conf->flags |= parent->flags & f; + f = SRVFLAG_LOG|SRVFLAG_NO_LOG; if ((srv_conf->flags & f) == 0) { srv_conf->flags |= parent->flags & f; blob - 7b00d7564bfffc954b9bca925c889977044b49db blob + c7bef17d3e53bb264e52c28c93e60015957b7784 --- httpd.h +++ httpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: httpd.h,v 1.169 2026/03/02 19:24:58 rsadowski Exp $ */ +/* $OpenBSD: httpd.h,v 1.170 2026/05/10 10:02:04 kirill Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter @@ -390,6 +390,7 @@ SPLAY_HEAD(client_tree, client); #define SRVFLAG_NO_PATH_REWRITE 0x02000000 #define SRVFLAG_GZIP_STATIC 0x04000000 #define SRVFLAG_NO_BANNER 0x08000000 +#define SRVFLAG_NO_GZIP_STATIC 0x10000000 #define SRVFLAG_LOCATION_FOUND 0x40000000 #define SRVFLAG_LOCATION_NOT_FOUND 0x80000000 @@ -399,8 +400,8 @@ SPLAY_HEAD(client_tree, client); "\14SYSLOG\15NO_SYSLOG\16TLS\17ACCESS_LOG\20ERROR_LOG" \ "\21AUTH\22NO_AUTH\23BLOCK\24NO_BLOCK\25LOCATION_MATCH" \ "\26SERVER_MATCH\27SERVER_HSTS\30DEFAULT_TYPE\31PATH_REWRITE" \ - "\32NO_PATH_REWRITE\34NO_BANNER\33GZIP_STATIC\37LOCATION_FOUND" \ - "\40LOCATION_NOT_FOUND" + "\32NO_PATH_REWRITE\34NO_BANNER\33GZIP_STATIC" \ + "\35NO_GZIP_STATIC\37LOCATION_FOUND\40LOCATION_NOT_FOUND" #define TCPFLAG_NODELAY 0x01 #define TCPFLAG_NNODELAY 0x02 blob - 6d7119b91435454da9173e5993e1e1679ef9aa22 blob + 7b026210bc3dbf9982aef9557f70fbdd723e7f81 --- parse.y +++ parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.131 2026/03/02 19:24:58 rsadowski Exp $ */ +/* $OpenBSD: parse.y,v 1.132 2026/05/10 10:02:04 kirill Exp $ */ /* * Copyright (c) 2020 Matthias Pressfreund @@ -1244,9 +1244,11 @@ fcgiport : NUMBER { gzip_static : NO GZIPSTATIC { srv->srv_conf.flags &= ~SRVFLAG_GZIP_STATIC; + srv->srv_conf.flags |= SRVFLAG_NO_GZIP_STATIC; } | GZIPSTATIC { srv->srv_conf.flags |= SRVFLAG_GZIP_STATIC; + srv->srv_conf.flags &= ~SRVFLAG_NO_GZIP_STATIC; } ;