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.
This commit is contained in:
Gerd Knops
2012-08-05 12:06:33 -05:00
committed by Allan Odgaard
parent b21fbd897e
commit c98bc92b5d

View File

@@ -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));