summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/http2/http2srv.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network/access/http2/http2srv.h')
-rw-r--r--tests/auto/network/access/http2/http2srv.h52
1 files changed, 25 insertions, 27 deletions
diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h
index baf0155988..dc94318527 100644
--- a/tests/auto/network/access/http2/http2srv.h
+++ b/tests/auto/network/access/http2/http2srv.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef HTTP2SRV_H
#define HTTP2SRV_H
@@ -83,16 +58,29 @@ public:
~Http2Server();
+ // To send responses with status code 1xx
+ void setInformationalStatusCode(int code);
// To be called before server started:
void enablePushPromise(bool enabled, const QByteArray &path = QByteArray());
void setResponseBody(const QByteArray &body);
// No content encoding is actually performed, call setResponseBody with already encoded data
void setContentEncoding(const QByteArray &contentEncoding);
+ // No authentication data is generated for the method, the full header value must be set
+ void setAuthenticationHeader(const QByteArray &authentication);
+ // Authentication always required, no challenge provided
+ void setAuthenticationRequired(bool enable);
+ // 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);
+ // Send a trailing HEADERS frame with PRIORITY and END_STREAM flag
+ void setSendTrailingHEADERS(bool enable);
void emulateGOAWAY(int timeout);
void redirectOpenStream(quint16 targetPort);
bool isClearText() const;
+ QByteArray requestAuthorizationHeader();
+
// Invokables, since we can call them from the main thread,
// but server (can) work on its own thread.
Q_INVOKABLE void startServer();
@@ -129,6 +117,8 @@ Q_SIGNALS:
void decompressionFailed(quint32 streamID);
void receivedRequest(quint32 streamID);
void receivedData(quint32 streamID);
+ // Emitted for every DATA frame. Includes the content of the frame as \a body.
+ void receivedDATAFrame(quint32 streamID, const QByteArray &body);
void windowUpdate(quint32 streamID);
void sendingData();
@@ -215,6 +205,14 @@ private:
QAtomicInt interrupted;
QByteArray contentEncoding;
+ QByteArray authenticationHeader;
+ bool authenticationRequired = false;
+
+ QByteArray redirectUrl;
+ int redirectCount = 0;
+
+ bool sendTrailingHEADERS = false;
+ int informationalStatusCode = 0;
protected slots:
void ignoreErrorSlot();
};