Re: [reSIProcate] How to respond to garbage requests
Okay, so maybe what we need to do is have a bool mValid in LazyParser that gets set to true after the parse (if the parse fails, an exception is thrown, and the bool never gets set to true). If we have mIsParsed and !mValid, encode() will just use the original hfv buffer.
Best regards, Byron Campen
On Aug 15, 2006, at 09.20, Byron Campen wrote:
When forming a 400 Bad Request response, is it better to leave out mandatory headers that were malformed in the request, or leave the malformed headers in the response exactly as they appeared in the request?
How long is a piece of string?
Seriously, I would argue in favor of leaving them in. The assumption I'm making is that the sender will be able to handle a response that is closely related to the garbage it spit out. If you remove mandatory headers that were malformed, you run the risk of exposing yet another bug / problem in the recipient UA. This could be a somewhat specious argument though, so you can likely build a case for either side.
A
|
Attachment:
smime.p7s
Description: S/MIME cryptographic signature