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 <phartmann@blackberry.com>
This commit is contained in:
parent
9d2d4ad483
commit
1a6a763254
@ -912,6 +912,19 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD
|
|||||||
} else if (name == "content-length") {
|
} else if (name == "content-length") {
|
||||||
httpReply->setContentLength(value.toLongLong());
|
httpReply->setContentLength(value.toLongLong());
|
||||||
} else {
|
} else {
|
||||||
|
if (value.contains('\0')) {
|
||||||
|
QList<QByteArray> 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);
|
httpReply->setHeaderField(name, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user