From 9713785e87b150a2d9bcf3543ec1f2de269e7efd Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sun, 7 Jan 2001 22:45:26 +0000 Subject: [PATCH] Strip trailing stuff from mime types. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87607 13f79535-47bb-0310-9956-ffa450edef68 --- server/config.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server/config.c b/server/config.c index 93ccd1201b..db15655c57 100644 --- a/server/config.c +++ b/server/config.c @@ -281,26 +281,26 @@ int ap_invoke_handler(request_rec *r) const char *handler; const char *p; size_t handler_len; - int result = HTTP_INTERNAL_SERVER_ERROR; + int result; + char hbuf[MAX_STRING_LEN]; if (r->handler) { handler = r->handler; - handler_len = strlen(handler); } else { handler = r->content_type ? r->content_type : ap_default_type(r); - if ((p = ap_strchr_c(handler, ';')) != NULL) { + if (ap_strchr_c(handler, ';') != NULL) { + apr_cpystrn(hbuf, handler, sizeof hbuf); + handler = hbuf; + p = ap_strchr_c(handler, ';'); /* MIME type arguments */ while (p > handler && p[-1] == ' ') --p; /* strip trailing spaces */ - handler_len = p - handler; - } - else { - handler_len = strlen(handler); + *p='\0'; } } - result=ap_run_handler(handler,r); + result = ap_run_handler(handler ,r); if (result == DECLINED && r->handler && r->filename) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r, -- 2.50.1