-
Notifications
You must be signed in to change notification settings - Fork 816
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
Make extraction of ETag header independent of capitalisation #7720
Conversation
Actually, when first proposing this pull request, I thought that raw headers in Qt were not case-insensitive at all; this is not the case. Raw headers in Qt are case-insensitive, but using --- a/src/libsync/networkjobs.cpp
+++ b/src/libsync/networkjobs.cpp
@@ -999,7 +999,7 @@ bool JsonApiJob::finished()
}
// save new ETag value
- if(reply()->rawHeaderList().contains("ETag"))
+ if(reply()->hasRawHeader("ETag"))
emit etagResponseHeaderReceived(reply()->rawHeader("ETag"), statusCode);
QJsonParseError error{}; Still, my original patch works and does, in my opinion, not have any downsides compared to this one. |
I have now also fixed the same code in |
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.
A couple of nitpicks but LGTM
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.
Awesome, thanks!
Fixes nextcloud#7703. Signed-off-by: Joshua Noeske <git@joshuanoeske.de>
Hi, thanks for merging! My I quickly ask, why is this not included in the 3.15.3 milestone? It is a rather annoying bug in my opinion. If there's nothing that keeps this from being included in 3.15.3, I'd like to kindly ask you to reconsider this for 3.15.3. Thanks! |
Fixes #7703.
Without this pull request, the extraction of the ETag header in a reply from the server is dependent on the capitalisation of the name of the field being
ETag
becauserawHeaderList().contains()
is not case-insensitive. However, according to the standard, header field names are case-insensitive. This pull request makes the extraction of the ETag header case-insensitive by using theheader
function instead ofrawHeaderList().contains()
. Internally, Qt performs a case-insensitive comparison of the field names, as can be seen here.I have tested this with my server and can confirm that I see notifications again.