diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2016-12-22 19:23:10 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2016-12-22 19:23:10 +0000 |
commit | 41a849ac437e079fa097ac271976411b3597868b (patch) | |
tree | fff8d5d8f0a108c3f2006db41e8eee91ab5fdfb5 | |
parent | cc3458b71bd636811862e1b074f4bf85313cb7bd (diff) | |
download | httpd-41a849ac437e079fa097ac271976411b3597868b.tar.gz |
Backports: r1188745
Submitted by: rpluem
Correctly return a 400 (Bad request) in case of a HTTP/0.9 request like
GET @example.org/foo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x-merge-http-strict@1775706 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | server/protocol.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/protocol.c b/server/protocol.c index 121e084dbb..0fc47728eb 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -982,15 +982,15 @@ request_rec *ap_read_request(conn_rec *conn) if (!read_request_line(r, tmp_bb)) { if (r->status == HTTP_REQUEST_URI_TOO_LARGE || r->status == HTTP_BAD_REQUEST) { - if (r->status == HTTP_BAD_REQUEST) { - ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, - "request failed: invalid characters in URI"); - } - else { + if (r->status == HTTP_REQUEST_URI_TOO_LARGE) { ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "request failed: URI too long (longer than %d)", r->server->limit_req_line); } + else if (r->method == NULL) { + ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, + "request failed: invalid characters in URI"); + } ap_send_error_response(r, 0); ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r); ap_run_log_transaction(r); |