summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/http2/http2srv.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2023-10-02 15:55:48 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2023-11-15 13:18:13 +0200
commitf4c8e11ad7a2c24da15aecefd0965fcc8af25349 (patch)
treebe58e8c0948c95a9166ff75b1467b7ced36fc8b2 /tests/auto/network/access/http2/http2srv.cpp
parent668ce80e9e0c37823312c4ebf3d11194a509f0ff (diff)
tst_http2: increase testing for authenticationRequired
Make sure the reply is marked as finished and that the body is received even if we didn't succeed. In a real scenario that would include some text like Access Denied. Also, no longer clear() the authenticationHeader in the server, since that meant the server would not send the header again if the client failed to authenticate. Luckily this wasn't actually causing any problems before, since we only tested the expected www-authenticate header. As a drive-by: clang-tidy complained about not using const-ref for a lambda. Pick-to: 6.6 6.5 6.2 Change-Id: Ia4452fff7d9370d7d460433257d84eff0a6f469b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/network/access/http2/http2srv.cpp')
-rw-r--r--tests/auto/network/access/http2/http2srv.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp
index 91d57a5caa..d7c8c2fd8e 100644
--- a/tests/auto/network/access/http2/http2srv.cpp
+++ b/tests/auto/network/access/http2/http2srv.cpp
@@ -864,7 +864,6 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody)
} else if (!authenticationHeader.isEmpty() && !hasAuth) {
header.push_back({ ":status", "401" });
header.push_back(HPack::HeaderField("www-authenticate", authenticationHeader));
- authenticationHeader.clear();
} else {
header.push_back({":status", "200"});
}