Sudheer Vinukonda created TS-3394:
-------------------------------------
Summary: Return an error on a non-http response
Key: TS-3394
URL: https://issues.apache.org/jira/browse/TS-3394
Project: Traffic Server
Issue Type: Improvement
Components: HTTP
Reporter: Sudheer Vinukonda
Currently, ATS does not return an error on a non-http response. For example,
please see below:
{code}
[sudheerv@dev1 trafficserver]$ curl -x localhost:80 127.0.0.1:22
SSH-2.0-OpenSSH_5.3
Protocol mismatch.
{code}
This may allow someone to detect the services running on different ports.
Opening this jira to return an error in case of a non-http response. The error
returned will be something like "502 Invalid HTTP Response".
The below simple patch fixes this:
{code}
diff --git a/proxy/hdrs/HTTP.cc b/proxy/hdrs/HTTP.cc
index 5933381..9d1ccb6 100644
--- a/proxy/hdrs/HTTP.cc
+++ b/proxy/hdrs/HTTP.cc
@@ -1246,7 +1246,7 @@ http_parser_parse_resp(HTTPParser *parser, HdrHeap *heap,
HTTPHdrImpl *hh, const
eoh:
*start = old_start;
- return PARSE_DONE;
+ return PARSE_ERROR;
done:
if (!version_start || !version_end) {
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)