Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics server not responding with HTTP 1.1 #927

Open
cirvladimir opened this issue Jun 20, 2023 · 1 comment
Open

Metrics server not responding with HTTP 1.1 #927

cirvladimir opened this issue Jun 20, 2023 · 1 comment

Comments

@cirvladimir
Copy link

I'm using the default way of starting the server with start_http_server(). I noticed that the server responds with HTTP/1.0 to HTTP/1.1 requests. Is there a flag I need to set to support HTTP/1.1?

@jvperrin
Copy link

In case anyone else comes across this and wants to change the version, it's coming from wsgiref.handlers in the python stdlib: https://github.com/python/cpython/blob/3.11/Lib/wsgiref/handlers.py#L104

You can change to using 1.1 by doing this:

from wsgiref.simple_server import ServerHandler

ServerHandler.http_version = "1.1"

Then later on when you call start_http_server(8000) (or similar) it will use this HTTP version and respond with HTTP/1.1 200 OK in responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants