GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [Bug] Request body lost when Upgrade: h2c + Transfer-Encoding: chunked is used · Issue #124 · MagicStack/httptools Open DescriptionOverviewWhen sending a The request looked like this: On the server side, Uvicorn logs showed:
But when we routed the same request through ngrok or used 🔍 Root CauseAfter analyzing Uvicorn’s
Proposed FixPatch cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1: cdef HttpParser pyparser = <HttpParser>parser.data try: if parser.upgrade and not pyparser._should_upgrade(): cparser.llhttp_resume_after_upgrade(parser) pyparser._on_headers_complete() except BaseException as ex: pyparser._last_error = ex return -1 return 0 Also expose this from Python: def resume_after_upgrade(self): httptools.llhttp_resume_after_upgrade(self.cparser) Then frameworks like Uvicorn can call it in: def on_headers_complete(self): if self.upgrade and self.upgrade.lower() != b"websocket": self.parser.resume_after_upgrade() Reproducible TestWhy it mattersThis is RFC-compliant behavior that should be supported. RestClient in Java 21+ sends Upgrade: h2c by default. Any server not resetting its parser state will lose the body. This breaks many interop scenarios between Spring Boot and Python ASGI apps. I'm happy to submit a PR if maintainers are open to it. Thanks for your time and for maintaining this great project! Reacted by Ivan Seleznev and Max Lepikhin ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |