You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2016/12/08 19:54:49 UTC
svn commit: r1773292 - /httpd/httpd/trunk/modules/http/http_filters.c
Author: covener
Date: Thu Dec 8 19:54:49 2016
New Revision: 1773292
URL: http://svn.apache.org/viewvc?rev=1773292&view=rev
Log:
revert r1773285
breaks some existing tests. Needs more work.
Modified:
httpd/httpd/trunk/modules/http/http_filters.c
Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1773292&r1=1773291&r2=1773292&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Thu Dec 8 19:54:49 2016
@@ -632,7 +632,6 @@ apr_status_t ap_http_filter(ap_filter_t
struct check_header_ctx {
request_rec *r;
int strict;
- const char *badheader;
};
/* check a single header, to be used with apr_table_do() */
@@ -658,7 +657,6 @@ static int check_header(void *arg, const
"Response header name '%s' contains invalid "
"characters, aborting request",
name);
- ctx->badheader = name;
return 0;
}
@@ -668,7 +666,6 @@ static int check_header(void *arg, const
"Response header '%s' value of '%s' contains invalid "
"characters, aborting request",
name, val);
- ctx->badheader = name;
return 0;
}
return 1;
@@ -683,21 +680,13 @@ static APR_INLINE int check_headers(requ
struct check_header_ctx ctx;
core_server_config *conf =
ap_get_core_module_config(r->server->module_config);
- int rv = 1;
ctx.r = r;
ctx.strict = (conf->http_conformance != AP_HTTP_CONFORMANCE_UNSAFE);
- ctx.badheader = NULL;
+ if (!apr_table_do(check_header, &ctx, r->headers_out, NULL))
+ return 0; /* problem has been logged by check_header() */
- while (!apr_table_do(check_header, &ctx, r->headers_out, NULL)){
- if (ctx.badheader) {
- apr_table_unset(r->headers_out, ctx.badheader);
- apr_table_unset(r->err_headers_out, ctx.badheader);
- }
- rv = 0; /* problem has been logged by check_header() */
- }
-
- return rv;
+ return 1;
}
typedef struct header_struct {
@@ -1260,7 +1249,8 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
}
if (!check_headers(r)) {
- r->status = 500;
+ ap_die(HTTP_INTERNAL_SERVER_ERROR, r);
+ return AP_FILTER_ERROR;
}
/*