swift-nio icon indicating copy to clipboard operation
swift-nio copied to clipboard

Return response when header validation fails

Open 0xTim opened this issue 7 months ago • 0 comments

Allow the NIOHTTPResponseHeadersValidator to be configured to return a response if the header validation fails. This allows something to be returned to client and can fix issues where proxies might mark a node as bad if a RST is returned. This has to be done in the validator since all future writes are dropped so any error handler won't be able to catch the error and write out a fallback response.

I haven't touched trailer validation, not sure if you want me to look at that. I don't know if an empty end would be valid as other data would have been already written to the channel.

0xTim avatar Aug 13 '25 11:08 0xTim