diff options
Diffstat (limited to 'linden/indra/test/lliohttpserver_tut.cpp')
-rw-r--r-- | linden/indra/test/lliohttpserver_tut.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/linden/indra/test/lliohttpserver_tut.cpp b/linden/indra/test/lliohttpserver_tut.cpp index e9b04c9..e450cc4 100644 --- a/linden/indra/test/lliohttpserver_tut.cpp +++ b/linden/indra/test/lliohttpserver_tut.cpp | |||
@@ -125,7 +125,7 @@ namespace tut | |||
125 | pump->addChain(chain, DEFAULT_CHAIN_EXPIRY_SECS); | 125 | pump->addChain(chain, DEFAULT_CHAIN_EXPIRY_SECS); |
126 | 126 | ||
127 | pumpPipe(pump, 10); | 127 | pumpPipe(pump, 10); |
128 | if(mResponse && (! timeout)) | 128 | if(mResponse.notNull() && (! timeout)) |
129 | { | 129 | { |
130 | mResponse->result(mResult); | 130 | mResponse->result(mResult); |
131 | mResponse = NULL; | 131 | mResponse = NULL; |
@@ -138,7 +138,7 @@ namespace tut | |||
138 | delete pump; | 138 | delete pump; |
139 | apr_pool_destroy(pool); | 139 | apr_pool_destroy(pool); |
140 | 140 | ||
141 | if(mResponse && timeout) | 141 | if(mResponse.notNull() && timeout) |
142 | { | 142 | { |
143 | mResponse->result(mResult); | 143 | mResponse->result(mResult); |
144 | mResponse = NULL; | 144 | mResponse = NULL; |
@@ -327,6 +327,23 @@ namespace tut | |||
327 | ensure_starts_with("large echo status", result, "HTTP/1.0 200 OK\r\n"); | 327 | ensure_starts_with("large echo status", result, "HTTP/1.0 200 OK\r\n"); |
328 | } | 328 | } |
329 | 329 | ||
330 | template<> template<> | ||
331 | void HTTPServiceTestObject::test<8>() | ||
332 | { | ||
333 | // test the OPTIONS http method -- the default implementation | ||
334 | // should return the X-Documentation-URL | ||
335 | std::ostringstream http_request; | ||
336 | http_request << "OPTIONS / HTTP/1.0\r\nHost: localhost\r\n\r\n"; | ||
337 | bool timeout = false; | ||
338 | std::string result = makeRequest("/", http_request.str(), timeout); | ||
339 | ensure_starts_with("OPTIONS verb ok", result, "HTTP/1.0 200 OK\r\n"); | ||
340 | ensure_contains( | ||
341 | "Doc url header exists", | ||
342 | result, | ||
343 | "X-Documentation-URL: http://localhost"); | ||
344 | } | ||
345 | |||
346 | |||
330 | /* TO DO: | 347 | /* TO DO: |
331 | test generation of not found and method not allowed errors | 348 | test generation of not found and method not allowed errors |
332 | */ | 349 | */ |