-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Sending default 'Server' header when failing on wrong HTTP method #8870
Comments
Can you provide a complete reproducer? It's not clear what is meant by "SERVER_SOFTWARE values was changed" or how you're doing it... |
reproducing
then run curl -vv -X HZ h:z@127.0.0.1:8080/ response header |
OK, I don't think that's a supported way to change the header. I assume that the default handler takes a reference on import, before you've changed the global. |
I only see it referenced in one place, so I don't see any reason the behaviour would be different whether the method is correct or not... I think the correct way to handle this would be a middleware, but I think middlewares may not run on system routes (e.g. when a matching handler is not found), though I think this is something we could consider changing. |
That should work. |
Describe the bug
When server receives HTTP request with wrong HTTP method (not one of GET,POST ...etc...) response contains a default SERVER_SOFTWARE value even if SERVER_SOFTWARE values was changed.
To Reproduce
curl -vv -X HZ h:z@127.0.0.1:8080/
Expected behavior
After changing SERVER_SOFTWARE it must be modified in all scopes.
Logs/tracebacks
Python Version
Python 3.11.8
aiohttp Version
3.9.5
multidict Version
Version: 6.0.5
yarl Version
Version: 1.9.4
OS
Linux
Related component
Server
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: