Bug 65225 - Return 505 HTTP Version Not Supported if protocol is HTTP and if version is not supported!
Summary: Return 505 HTTP Version Not Supported if protocol is HTTP and if version is n...
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-08 16:56 UTC by WebTestingRL
Modified: 2021-04-20 17:44 UTC (History)
0 users



Attachments
error 505 fix (797 bytes, patch)
2021-04-18 15:04 UTC, Giovanni Bechis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description WebTestingRL 2021-04-08 16:56:01 UTC
Like many other web servers, it would be nice for Apache sends 505 HTTP Version Not Supported when the protocol is HTTP and the version is not supported.

Right now, it only sends 400 Bad Request. But it would be perfect to send 505 HTTP Version Not Supported for the appropriate situations.
Comment 1 Giovanni Bechis 2021-04-18 15:04:19 UTC
Created attachment 37815 [details]
error 505 fix

This diff fixes the issue, I wonder if there is a better method to check for http protocol version.
Comment 2 Ruediger Pluem 2021-04-19 08:00:26 UTC
(In reply to Giovanni Bechis from comment #1)
> Created attachment 37815 [details]
> error 505 fix
> 
> This diff fixes the issue, I wonder if there is a better method to check for
> http protocol version.

I don't like the patch because there could be 3rd party modules implementing later versions of HTTP. Please see also

https://lists.apache.org/thread.html/ra41dbcfc579d04887cc0644fc6803f0ae0f154291c058f52aee1c4df%40%3Cdev.httpd.apache.org%3E

and the whole thread:

https://lists.apache.org/thread.html/red499ac4750b88e5943c25abb86434c59dfff4d4f386ffc53742755d%40%3Cdev.httpd.apache.org%3E
Comment 3 WebTestingRL 2021-04-20 17:44:38 UTC
Maybe a variable that says if the protocol is supported or not? So, if a module would be created for > http2, it can mention if protocol is supported or not.

like r->protocol_supported or something of that kind.

That could also be that the associated modules with the protocols would set this variable.

Or just check if the protocol is HTTP, and the version is > 0.9, and send the status there.