Skip to content
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

fix: http header keys are case in-sensitive #11992

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Conversation

DeepDiver1975
Copy link
Member

@DeepDiver1975 DeepDiver1975 commented Nov 25, 2024

This is a workaround to get response bodies printed into the log file in case the http response keys are al lower case.

Background: comparing keys case sensitive is wrong as http header keys are case in-sensitive as per definition:

https://www.rfc-editor.org/rfc/rfc7230#section-3.2

   Each header field consists of a case-insensitive field name followed
   by a colon (":"), optional leading whitespace, the field value, and
   optional trailing whitespace.

A true fix requires to work on QNetworkReply::headers(), QHttpHeaders::value() and QHttpHeaders::WellKnownHeader::ContentType .... but this raises the Qt minimum version to 6.8 due to replay->headers()
https://doc.qt.io/qt-6/qnetworkreply.html#headers

@erikjv erikjv merged commit 83d7be7 into master Nov 25, 2024
6 checks passed
@erikjv erikjv deleted the fix/httplogger-content-type branch November 25, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants