Skip to content

Commit 83d7be7

Browse files
DeepDiver1975erikjv
authored andcommitted
fix: http header keys are case in-sensitive
1 parent d4e3682 commit 83d7be7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libsync/httplogger.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ void logHttp(const QByteArray &verb, HttpContext *ctx, QJsonObject &&header, QIO
105105

106106
QJsonObject body = {{QStringLiteral("length"), contentLength}};
107107
if (contentLength > 0) {
108-
const QString contentType = header.value(QStringLiteral("Content-Type")).toString();
108+
QString contentType = header.value(QStringLiteral("Content-Type")).toString();
109+
if (contentType.isEmpty()) {
110+
contentType = header.value(QStringLiteral("content-type")).toString();
111+
}
109112
if (isTextBody(contentType)) {
110113
if (!device->isOpen()) {
111114
Q_ASSERT(dynamic_cast<QBuffer *>(device));

0 commit comments

Comments
 (0)