diff --git a/tests/auto/quick/dialogs/BLACKLIST b/tests/auto/quick/dialogs/BLACKLIST
deleted file mode 100644
index 19380e01e67b04a4b8d654fd08f6696bd8973650..0000000000000000000000000000000000000000
--- a/tests/auto/quick/dialogs/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[authenticationDialogRequested:Proxy Authentication Dialog]
-*
diff --git a/tests/auto/quick/dialogs/server.cpp b/tests/auto/quick/dialogs/server.cpp
index dc9cfe582aaed74e208af4562400e5fa6ffe953d..dfc7c97ad785724b1c9fd2673cf650420a882843 100644
--- a/tests/auto/quick/dialogs/server.cpp
+++ b/tests/auto/quick/dialogs/server.cpp
@@ -33,7 +33,6 @@
 
 Server::Server(QObject *parent) : QObject(parent)
 {
-    m_data.clear();
     connect(&m_server, &QTcpServer::newConnection, this, &Server::handleNewConnection);
 }
 
@@ -42,6 +41,11 @@ bool Server::isListening()
     return m_server.isListening();
 }
 
+void Server::setReply(const QByteArray &reply)
+{
+    m_reply = reply;
+}
+
 void Server::run()
 {
     if (!m_server.listen(QHostAddress::LocalHost, 5555))
@@ -69,12 +73,7 @@ void Server::handleReadReady()
     if (!m_data.endsWith("\r\n\r\n"))
         return;
 
-    if (m_data.contains(QByteArrayLiteral("OPEN_AUTH")))
-        socket->write("HTTP/1.1 401 Unauthorized\nWWW-Authenticate: "
-                      "Basic realm=\"Very Restricted Area\"\r\n\r\n");
-    if (m_data.contains(QByteArrayLiteral("OPEN_PROXY")))
-        socket->write("HTTP/1.1 407 Proxy Auth Required\nProxy-Authenticate: "
-                      "Basic realm=\"Proxy requires authentication\"\r\n\r\n");
+    socket->write(m_reply);
     m_data.clear();
     socket->disconnectFromHost();
 }
diff --git a/tests/auto/quick/dialogs/server.h b/tests/auto/quick/dialogs/server.h
index 24da47523a45623da9ceb0c328aee0480edaf42a..fa9a73811ad3ee51122f774a8a5d9aa7ecd484c7 100644
--- a/tests/auto/quick/dialogs/server.h
+++ b/tests/auto/quick/dialogs/server.h
@@ -40,6 +40,7 @@ public:
     explicit Server(QObject *parent = nullptr);
 
     bool isListening();
+    void setReply(const QByteArray &reply);
 
 public slots:
     void run();
@@ -50,6 +51,7 @@ private slots:
 
 private:
     QByteArray m_data;
+    QByteArray m_reply;
     QTcpServer m_server;
 
 };
diff --git a/tests/auto/quick/dialogs/tst_dialogs.cpp b/tests/auto/quick/dialogs/tst_dialogs.cpp
index cecea1831da16cf10167f79f80f881593a4894f8..26a0fe034a0f9b33695413c6a7db12356ef0df5d 100644
--- a/tests/auto/quick/dialogs/tst_dialogs.cpp
+++ b/tests/auto/quick/dialogs/tst_dialogs.cpp
@@ -145,12 +145,19 @@ void tst_Dialogs::authenticationDialogRequested_data()
     QTest::addColumn<QUrl>("url");
     QTest::addColumn<QQuickWebEngineAuthenticationDialogRequest::AuthenticationType>("type");
     QTest::addColumn<QString>("realm");
-    QTest::newRow("Http Authentication Dialog") << QUrl("http://localhost:5555/OPEN_AUTH")
+    QTest::addColumn<QByteArray>("reply");
+    QTest::newRow("Http Authentication Dialog") << QUrl("http://localhost:5555/")
                                                 << QQuickWebEngineAuthenticationDialogRequest::AuthenticationTypeHTTP
-                                                << QStringLiteral("Very Restricted Area");
-    QTest::newRow("Proxy Authentication Dialog") << QUrl("http://localhost.:5555/OPEN_PROXY")
+                                                << QStringLiteral("Very Restricted Area")
+                                                << QByteArrayLiteral("HTTP/1.1 401 Unauthorized\nWWW-Authenticate: "
+                                                                     "Basic realm=\"Very Restricted Area\"\r\n\r\n");
+    QTest::newRow("Proxy Authentication Dialog")<< QUrl("http://qt.io/")
                                                 << QQuickWebEngineAuthenticationDialogRequest::AuthenticationTypeProxy
-                                                << QStringLiteral("Proxy requires authentication");
+                                                << QStringLiteral("Proxy requires authentication")
+                                                << QByteArrayLiteral("HTTP/1.1 407 Proxy Auth Required\nProxy-Authenticate: "
+                                                                "Basic realm=\"Proxy requires authentication\"\r\n"
+                                                                "content-length: 0\r\n\r\n");
+
 }
 
 void tst_Dialogs::authenticationDialogRequested()
@@ -159,7 +166,9 @@ void tst_Dialogs::authenticationDialogRequested()
     QFETCH(QQuickWebEngineAuthenticationDialogRequest::AuthenticationType, type);
     QFETCH(QString, realm);
 
+    QFETCH(QByteArray, reply);
     Server server;
+    server.setReply(reply);
     server.run();
     QTRY_VERIFY2(server.isListening(), "Could not setup authentication server");