1
1
/* **
2
2
* ==++==
3
3
*
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
7
7
* You may obtain a copy of the License at
8
8
* http://www.apache.org/licenses/LICENSE-2.0
9
- *
9
+ *
10
10
* Unless required by applicable law or agreed to in writing, software
11
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37
37
#endif
38
38
#endif
39
39
40
- using namespace web ;
40
+ using namespace web ;
41
41
using namespace utility ;
42
42
using namespace concurrency ;
43
43
using namespace web ::http;
@@ -76,7 +76,7 @@ TEST_FIXTURE(uri_address, auth_no_data, "Ignore:Linux", "89", "Ignore:Apple", "8
76
76
headers[U (" WWW-Authenticate" )] = U (" Basic realm = \" WallyWorld\" " );
77
77
78
78
// unauthorized
79
- p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers);
79
+ p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers);
80
80
81
81
}).then ([&scoped, replyFunc]()
82
82
{
@@ -118,7 +118,7 @@ TEST_FIXTURE(uri_address, proxy_auth_known_contentlength, "Ignore:Linux", "88",
118
118
headers[U (" WWW-Authenticate" )] = U (" Basic realm = \" WallyWorld\" " );
119
119
120
120
// unauthorized
121
- p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers);
121
+ p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers);
122
122
123
123
}).then ([&scoped, replyFunc]()
124
124
{
@@ -153,7 +153,7 @@ TEST_FIXTURE(uri_address, proxy_auth_noseek, "Ignore:Linux", "88", "Ignore:Apple
153
153
headers[U (" WWW-Authenticate" )] = U (" Basic realm = \" WallyWorld\" " );
154
154
155
155
// unauthorized
156
- p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers);
156
+ p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers);
157
157
158
158
});
159
159
@@ -194,7 +194,7 @@ TEST_FIXTURE(uri_address, proxy_auth_unknown_contentlength, "Ignore:Linux", "88"
194
194
headers[U (" WWW-Authenticate" )] = U (" Basic realm = \" WallyWorld\" " );
195
195
196
196
// unauthorized
197
- p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers);
197
+ p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers);
198
198
199
199
}).then ([&scoped, replyFunc]()
200
200
{
@@ -218,7 +218,7 @@ TEST_FIXTURE(uri_address, empty_username_password)
218
218
// Auth header
219
219
headers[U (" WWW-Authenticate" )] = U (" Basic realm = \" myRealm\" " );
220
220
// unauthorized
221
- p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers, " a" );
221
+ p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers, " a" );
222
222
});
223
223
224
224
http_response response = client.request (methods::GET).get ();
@@ -249,7 +249,7 @@ TEST_FIXTURE(uri_address, error_after_valid_credentials, "Ignore:Linux", "89", "
249
249
headers[U (" WWW-Authenticate" )] = U (" Basic realm = \" WallyWorld\" " );
250
250
headers[U (" h1" )] = U (" data2" );
251
251
// still unauthorized after the user has resent the request with the credentials
252
- p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers, " def" );
252
+ p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers, " def" );
253
253
};
254
254
255
255
scoped.server ()->next_request ().then ([&](test_request *p_request)
@@ -259,7 +259,7 @@ TEST_FIXTURE(uri_address, error_after_valid_credentials, "Ignore:Linux", "89", "
259
259
// Auth header
260
260
headers[U (" WWW-Authenticate" )] = U (" Basic realm = \" myRealm\" " );
261
261
// unauthorized
262
- p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers, " abc" );
262
+ p_request->reply (status_codes::Unauthorized, U (" Authentication Failed" ), headers, " abc" );
263
263
}).then ([&scoped, &replyFunc]()
264
264
{
265
265
// Client resent the request
@@ -348,7 +348,7 @@ TEST_FIXTURE(server_properties, unsuccessful_auth_with_basic_cred, "Requires", "
348
348
349
349
http_client_config config;
350
350
config.set_credentials (credentials (m_username, m_password));
351
-
351
+
352
352
http_client client (m_uri, config);
353
353
http_response response = client.request (methods::GET).get ();
354
354
VERIFY_ARE_EQUAL (status_codes::Unauthorized, response.status_code ());
@@ -423,7 +423,7 @@ TEST_FIXTURE(uri_address, set_user_options_winrt)
423
423
test_http_server::scoped_server scoped (m_uri);
424
424
scoped.server ()->next_request ().then ([](test_request *p_request)
425
425
{
426
- p_request->reply (status_codes::OK);
426
+ p_request->reply (status_codes::OK);
427
427
});
428
428
429
429
http_client_config config;
@@ -451,7 +451,7 @@ TEST_FIXTURE(server_properties, set_user_options, "Requires", "Server;UserName;P
451
451
DWORD policy = WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW;
452
452
if (!WinHttpSetOption (handle,
453
453
WINHTTP_OPTION_AUTOLOGON_POLICY,
454
- &policy,
454
+ &policy,
455
455
sizeof (policy)))
456
456
{
457
457
throw std::runtime_error (" The Test Error" );
@@ -595,7 +595,7 @@ TEST_FIXTURE(uri_address, set_user_options_exceptions)
595
595
VERIFY_THROWS (client.request (methods::GET).get (), std::runtime_error);
596
596
}
597
597
#endif // _MS_WINDOWS
598
- #pragma endregion
598
+ #pragma endregion
599
599
600
600
// Fix for 522831 AV after failed authentication attempt
601
601
TEST_FIXTURE (uri_address, failed_authentication_attempt, " Ignore:Linux" , " 89" , " Ignore:Apple" , " 89" )
0 commit comments