[
https://issues.apache.org/jira/browse/TS-3394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14326608#comment-14326608
]
Sudheer Vinukonda commented on TS-3394:
---------------------------------------
Hmm, I am wondering if this knob will even be needed in 6.0+, as we plan to
remove HTTP/0.9 support (TS-3327).
The http parser simply stops moving forward if it sees a non-http response,
which means it doesn't (try to) extract status or any other field which are
mandatory for non-0.9 version. So, removing HTTP/0.9 support would
automatically result in returning errors, regardless of parser returning error
or not.
> 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
> Assignee: Sudheer Vinukonda
> Fix For: 5.3.0
>
>
> 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)