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)
110
110
111
111
// no content length
112
112
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
+ }
114
119
115
120
#ifdef _MS_WINDOWS
116
121
// utf-16le
@@ -237,7 +242,12 @@ TEST_FIXTURE(uri_address, extract_json)
237
242
VERIFY_ARE_EQUAL (data.to_string (), rsp.extract_json ().get ().to_string ());
238
243
239
244
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
+ }
241
251
242
252
#ifdef _MS_WINDOWS
243
253
// utf-16le
You can’t perform that action at this time.
0 commit comments