Fix API authentication being broken with clients that send an unauthenticated request first#10862
Open
jschmidt-icinga wants to merge 1 commit into
Open
Fix API authentication being broken with clients that send an unauthenticated request first#10862jschmidt-icinga wants to merge 1 commit into
jschmidt-icinga wants to merge 1 commit into
Conversation
This is necessary, since `SendJsonError()` also clears the entire response and possible because it doesn't on its own *send* the message yet.
dbf97cc to
4939c53
Compare
|
@jschmidt-icinga would be nice if we get a bugfix release with this soon, thanks in advance! |
Contributor
Author
|
@rotanid We're currently preparing a security release to be released on Monday. After that we'll prioritize a bugfix release that'll incorporate this fix among others, but I can't give you a timeline at this point. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The single commit just moves setting the
www_authenticateheader field to afterSendJsonError()has initialized the message. The respective unit-test now also checks for the header in the response and I've added some documentation on this potentially unexpected behavior ofSendJsonError().We should maybe consider some minor refactoring of these
SendJson(Error|Body)functions to make clearer if they (re-initialize) the message or potentially do or don't send on their own.Fixes #10836.