From 773f390b0996cd88c2f4f9482cb5d276769275e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 9 Feb 2022 17:40:48 +0100 Subject: Http2: Fix redirect-handling The redirect handling for http2 was a little simple. E.g. not handling relative URLs. Fix this using the redirect response parsing function which the http1 protocol handler already uses. Fixes: QTBUG-100651 Change-Id: Ic0cec4cacc92707e7a7fde1f4665f80995a6057e Reviewed-by: Qt CI Bot Reviewed-by: Timur Pocheptsov (cherry picked from commit db5b8bbea3f3cf1675d2ddd449359b6fbedc523e) --- tests/auto/network/access/http2/http2srv.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/auto/network/access/http2/http2srv.h') diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h index 013af86cc8..5f8c5aa77e 100644 --- a/tests/auto/network/access/http2/http2srv.h +++ b/tests/auto/network/access/http2/http2srv.h @@ -88,6 +88,9 @@ public: void setResponseBody(const QByteArray &body); // No authentication data is generated for the method, the full header value must be set void setAuthenticationHeader(const QByteArray &authentication); + // Set the redirect URL and count. The server will return a redirect response with the url + // 'count' amount of times + void setRedirect(const QByteArray &redirectUrl, int count); void emulateGOAWAY(int timeout); void redirectOpenStream(quint16 targetPort); @@ -219,6 +222,9 @@ private: QAtomicInt interrupted; QByteArray authenticationHeader; + + QByteArray redirectUrl; + int redirectCount = 0; protected slots: void ignoreErrorSlot(); }; -- cgit v1.2.3