diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 02aca3d6c1..0f2d0873a7 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -7295,7 +7295,11 @@ void tst_QNetworkReply::qtbug45581WrongReplyStatusCode()
const QByteArray expectedContent =
""
- "\n";
+ ""
+#ifdef Q_OS_WIN
+ "\r"
+#endif
+ "\n";
QCOMPARE(reply->readAll(), expectedContent);