File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Release/tests/Functional/http/client Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,12 @@ TEST_FIXTURE(uri_address, extract_string)
110110
111111 // no content length
112112 rsp = send_request_response (scoped.server (), &client, U (" " ), utility::string_t ());
113- VERIFY_ARE_EQUAL (utility::string_t (U (" " )), rsp.extract_string ().get ());
113+ auto str = rsp.to_string ();
114+ // If there is no Content-Type in the response, make sure it won't throw when we ask for string
115+ if (str.find (U (" Content-Type" )) == std::string::npos)
116+ {
117+ VERIFY_ARE_EQUAL (utility::string_t (U (" " )), rsp.extract_string ().get ());
118+ }
114119
115120#ifdef _MS_WINDOWS
116121 // utf-16le
@@ -237,7 +242,12 @@ TEST_FIXTURE(uri_address, extract_json)
237242 VERIFY_ARE_EQUAL (data.to_string (), rsp.extract_json ().get ().to_string ());
238243
239244 rsp = send_request_response (scoped.server (), &client, U (" " ), utility::string_t ());
240- VERIFY_ARE_EQUAL (utility::string_t (U (" null" )), rsp.extract_json ().get ().to_string ());
245+ auto str = rsp.to_string ();
246+ // If there is no Content-Type in the response, make sure it won't throw when we ask for json
247+ if (str.find (U (" Content-Type" )) == std::string::npos)
248+ {
249+ VERIFY_ARE_EQUAL (utility::string_t (U (" null" )), rsp.extract_json ().get ().to_string ());
250+ }
241251
242252#ifdef _MS_WINDOWS
243253 // utf-16le
You can’t perform that action at this time.
0 commit comments