Skip to content

feat: add ExpectHandler for richer Expect: 100-continue handling#2175

Merged
erikdubbelboer merged 4 commits intovalyala:masterfrom
miretskiy:ymiretskiy/add-expect-handler
Apr 27, 2026
Merged

feat: add ExpectHandler for richer Expect: 100-continue handling#2175
erikdubbelboer merged 4 commits intovalyala:masterfrom
miretskiy:ymiretskiy/add-expect-handler

Conversation

@miretskiy
Copy link
Copy Markdown
Contributor

ContinueHandler only returns a bool, limiting the server to either accepting (100) or rejecting with 417. ExpectHandler allows returning any HTTP status code, and closes the connection on rejection since the client may have already started sending body data per RFC 9110.

ExpectHandler takes precedence when both handlers are set.

ContinueHandler only returns a bool, limiting the server to either
accepting (100) or rejecting with 417. ExpectHandler allows returning
any HTTP status code, and closes the connection on rejection since
the client may have already started sending body data per RFC 9110.

ExpectHandler takes precedence when both handlers are set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread server.go Outdated
Allows callers to inspect RemoteAddr, TLS state, or any other
connection metadata alongside headers, addressing reviewer feedback.
Documents that the response must not be modified by the handler.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Comment thread server.go Outdated
Comment thread server.go Outdated
miretskiy and others added 2 commits April 26, 2026 12:10
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
@miretskiy
Copy link
Copy Markdown
Contributor Author

All done.

@erikdubbelboer erikdubbelboer merged commit 19e4b24 into valyala:master Apr 27, 2026
11 checks passed
@erikdubbelboer
Copy link
Copy Markdown
Collaborator

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants