From c98bc92b5d935ce07ec8a87df626e92df711ec38 Mon Sep 17 00:00:00 2001 From: Gerd Knops Date: Sun, 5 Aug 2012 12:06:33 -0500 Subject: [PATCH] Accept HTTP/1.1 response in network tests GlimmerBlocker (http://GlimmerBlocker.org) and other proxies may intercept the web data and replace the HTTP/1.0 response with a HTTP/1.1 response. Modified test to accept either. --- Frameworks/network/tests/t_download.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Frameworks/network/tests/t_download.cc b/Frameworks/network/tests/t_download.cc index c0c2ab83..3ff96172 100644 --- a/Frameworks/network/tests/t_download.cc +++ b/Frameworks/network/tests/t_download.cc @@ -84,7 +84,8 @@ public: char fileContent[fileSize]; if(read(fd, fileContent, fileSize) == fileSize) { - TS_ASSERT_EQUALS(status, "HTTP/1.0 200 OK"); + // GlimmerBlocker.org might cause a "HTTP/1.1" response + TS_ASSERT(strcmp(status.c_str(),"HTTP/1.0 200 OK")==0 || strcmp(status.c_str(),"HTTP/1.1 200 OK")==0); TS_ASSERT(headers.find("content-length") != headers.end()); TS_ASSERT_EQUALS(headers.find("content-length")->second, text::format("%zu", fileSize)); TS_ASSERT_EQUALS(body, std::string(fileContent, fileContent + fileSize));