-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refine granularity of 400 and 502 error diagnostics #1151
base: main
Are you sure you want to change the base?
Conversation
e65c9c1
to
bb7535f
Compare
should solve #1150 |
18ada37
to
1f2b2b1
Compare
Signed-off-by: Eloi DEMOLIS <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
1f2b2b1
to
07c7ec0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could remove some commented code but otherwise this is exactly what we need!
format!("The first {marker} is invalid, make sure {CHARSET}.") | ||
} | ||
format!("A {marker} is invalid, make sure {CHARSET}.") | ||
// if let Some(Block::Header(Pair { key, .. })) = kawa.blocks.back() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe delete these lines entirely?
} else { | ||
format!("The first cookie is invalid, make sure {CHARSET}.") | ||
} | ||
// if kawa.detached.jar.len() > 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same remark
Follow up to #1143 and #1150.
This splits the
DETAILS
variable of errors 400 and 502 into 3 hexadecimal buffersSUCCESSFULLY_PARSED
,PARTIALLY_PARSED
, andINVALID
. This avoids any XSS attacks from this variable. The last valid header/trailer/cookie has also been removed fromMESSAGE
.The new 400 and 502 use JavaScript to display the hexadecimal buffers as utf-8 (using the safe
innerText
) and hopefully help the client fix the problem: