-
Notifications
You must be signed in to change notification settings - Fork 820
Make extraction of ETag header independent of capitalisation #7720
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
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 <[email protected]>
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! |
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
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.