From 2c434b9b606a13126766c2b8d7dc6033308ddc7f Mon Sep 17 00:00:00 2001 From: benno Date: Fri, 2 Sep 2022 07:38:14 +0000 Subject: [PATCH] Make newer mime type definitions take precedence over existing ones. Patch from Ben Fuller , helped along by florian@ ok florian@ and some mumblings from claudio who does not want okays in httpd. --- usr.sbin/httpd/httpd.c | 6 +++--- usr.sbin/httpd/httpd.conf.5 | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/usr.sbin/httpd/httpd.c b/usr.sbin/httpd/httpd.c index 2acecd1732f..af863cf2710 100644 --- a/usr.sbin/httpd/httpd.c +++ b/usr.sbin/httpd/httpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: httpd.c,v 1.72 2022/03/02 11:10:43 florian Exp $ */ +/* $OpenBSD: httpd.c,v 1.73 2022/09/02 07:38:14 benno Exp $ */ /* * Copyright (c) 2014 Reyk Floeter @@ -1080,9 +1080,9 @@ media_add(struct mediatypes *types, struct media_type *media) struct media_type *entry; if ((entry = RB_FIND(mediatypes, types, media)) != NULL) { - log_debug("%s: duplicated entry for \"%s\"", __func__, + log_debug("%s: entry overwritten for \"%s\"", __func__, media->media_name); - return (NULL); + media_delete(types, entry); } if ((entry = malloc(sizeof(*media))) == NULL) diff --git a/usr.sbin/httpd/httpd.conf.5 b/usr.sbin/httpd/httpd.conf.5 index b5f0be465a0..16b086a9ee0 100644 --- a/usr.sbin/httpd/httpd.conf.5 +++ b/usr.sbin/httpd/httpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: httpd.conf.5,v 1.121 2022/03/09 13:50:41 jsg Exp $ +.\" $OpenBSD: httpd.conf.5,v 1.122 2022/09/02 07:38:14 benno Exp $ .\" .\" Copyright (c) 2014, 2015 Reyk Floeter .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 9 2022 $ +.Dd $Mdocdate: September 2 2022 $ .Dt HTTPD.CONF 5 .Os .Sh NAME @@ -753,6 +753,7 @@ to the specified extension .Ar name . One or more names can be specified per line. Each line may end with an optional semicolon. +Later lines overwrite earlier lines. .It Ic include Ar file Include types definitions from an external file, for example .Pa /usr/share/misc/mime.types . -- 2.20.1