summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd/config.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2015-07-18 06:00:43 +0000
committerreyk <reyk@openbsd.org>2015-07-18 06:00:43 +0000
commitd24f6b1ee32aebb1a8ac74ce07c0b86a2f00a39d (patch)
tree3594611f1ca24fd417a118a97646277bc904f74e /usr.sbin/httpd/config.c
parentInsist that manual page file name extensions must begin with a digit, (diff)
downloadwireguard-openbsd-d24f6b1ee32aebb1a8ac74ce07c0b86a2f00a39d.tar.xz
wireguard-openbsd-d24f6b1ee32aebb1a8ac74ce07c0b86a2f00a39d.zip
Allow to change the default media type globally or per-location,
eg. default type text/html. OK florian@
Diffstat (limited to 'usr.sbin/httpd/config.c')
-rw-r--r--usr.sbin/httpd/config.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/httpd/config.c b/usr.sbin/httpd/config.c
index 046e63cedfc..2829bed563f 100644
--- a/usr.sbin/httpd/config.c
+++ b/usr.sbin/httpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.40 2015/07/18 05:41:18 florian Exp $ */
+/* $OpenBSD: config.c,v 1.41 2015/07/18 06:00:43 reyk Exp $ */
/*
* Copyright (c) 2011 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -436,6 +436,13 @@ config_getserver_config(struct httpd *env, struct server *srv,
goto fail;
}
+ f = SRVFLAG_DEFAULT_TYPE;
+ if ((srv_conf->flags & f) == 0) {
+ srv_conf->flags |= parent->flags & f;
+ memcpy(&srv_conf->default_type,
+ &parent->default_type, sizeof(struct media_type));
+ }
+
f = SRVFLAG_SERVER_HSTS;
srv_conf->flags |= parent->flags & f;
srv_conf->hsts_max_age = parent->hsts_max_age;