From 1a6a763254b1844cb3f951e724d58a0fd29f62b5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 26 Feb 2014 18:09:34 +0100 Subject: [PATCH] Handle multiple header values in SPDY SPDY sends multiple header values for the same header key by null-byte separating them. This patch maps the multiple values the same way qnetworkreplyhttpimpl.cpp does. With this patch applied we can now log on to GMail using SPDY. Change-Id: I03656ad1695d13b5c3ed252794dc6c89c67c7b97 Reviewed-by: Peter Hartmann --- src/network/access/qspdyprotocolhandler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/network/access/qspdyprotocolhandler.cpp b/src/network/access/qspdyprotocolhandler.cpp index f12b9535fe..d9d861f9b4 100644 --- a/src/network/access/qspdyprotocolhandler.cpp +++ b/src/network/access/qspdyprotocolhandler.cpp @@ -912,6 +912,19 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD } else if (name == "content-length") { httpReply->setContentLength(value.toLongLong()); } else { + if (value.contains('\0')) { + QList values = value.split('\0'); + QByteArray binder(", "); + if (name == "set-cookie") + binder = "\n"; + value.clear(); + Q_FOREACH (const QByteArray& ivalue, values) { + if (value.isEmpty()) + value = ivalue; + else + value += binder + ivalue; + } + } httpReply->setHeaderField(name, value); } }