Comments (4)
As we use llhttp, if you convince Node.js to change behaviour, then we'll update the Python parser to match. But, it'd be weird to have different behaviour depending on the parser used.
Given that the client in this case has violated the HTTP protocol, I don't think it really matters whether the behaviour is intuitive or not, it should never be encountered by an HTTP client.
from aiohttp.
That error is from the Python parser. With llhttp, you get the more accurate: Data after Connection: close:
.
from aiohttp.
A client that sends a "close" connection option MUST NOT send further requests on that connection (after the one containing the "close")
https://www.rfc-editor.org/rfc/rfc9112#section-9.6-5
For the server, it merely says that it should not process further requests. It does not say it should process the previous request. So, I think tweaking the Python parser to match the llhttp error is fine.
from aiohttp.
For the server, it merely says that it should not process further requests. It does not say it should process the previous request.
I suppose this might be technically allowable, but it's pretty unintuitive in my opinion. I would assume that data received after a connection has been declared closed should not invalidate previous valid messages sent on that connection.
I've since tested this on many more HTTP implementations.
These ones reject the second request without responding to the first:
- Hypercorn
- Node.js
These ones respond to the first request and ignore the second because the connection is closed:
(Mongoose and Uvicorn have changed sides on this because of reports that I submitted, so feel free to ignore those two)
- Apache httpd
- Cheroot
- cpp-httplib
- Dart stdlib
- FastHTTP
- Eclipse GlassFish
- Go net/http
- Gunicorn
- H2O
- HAProxy
- Hyper
- Microsoft IIS
- JetBrains Ktor
- Eclipse Jetty
- Libevent
- Libmicrohttpd
- Libsoup
- Lighttpd
- Mongoose
- Netty
- Nginx
- OpenBSD httpd
- OpenLiteSpeed
- Phusion Passenger
- PHP stdlib
- protocol-http1
- Puma
- Apple ServiceTalk
- Apache Tomcat
- Tornado
- Twisted
- OpenWrt uhttpd
- Unicorn
- Uvicorn
- Waitress
- WEBrick
- Akamai GHost
- Apache Traffic Server
- AWS Application Load Balancer
- AWS Classic Load Balancer
- Cloudflare
- Google Classic Application Load Balancer
- Envoy
- OpenBSD relayd
- Pingora
- Pound
- Squid
- Varnish
Given the behavior of other implementations, it's probably worth at least documenting that AIOHTTP handles things differently.
from aiohttp.
Related Issues (20)
- Support free-threaded Python 3.13 build HOT 2
- TypeError: _patch_task.<locals>.task_new_init() got an unexpected keyword argument 'eager_start' HOT 5
- Sending default 'Server' header when failing on wrong HTTP method HOT 6
- Websocket ping test has transient failures on loaded systems HOT 1
- Send 100-continue only when handler reads body
- typing error with `timeout` argument of `aiohttp.ClientSession` requests methods HOT 1
- Rename compress parameter HOT 6
- on_request_headers_sent params type was never imported into the top-level file. HOT 2
- AsyncResolver not passing on loop too aiodns.DNSResolver HOT 4
- test_web_sendfile_functional isn't testing sendfile
- Incorrect re-use future in _make_or_get_ssl_context HOT 10
- ClientSession.get() doesn't support hostname.
- MIsing header file HOT 1
- Replace blockdiag HOT 1
- 3.9.2 server keep-alive timeout can cause disconnect of active connections and hence client server disconnect errors HOT 18
- Disable retry in tests
- add `Sequence[str | int]` typing in `_RequestOptions.params` HOT 2
- Middleware fix up is unexpectedly expensive HOT 2
- Regression in aiohttp 3.10.3 when running multiple loops in multiple threads HOT 2
- Remove make_mocked_coro()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp.