OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/web/public/test/response_providers/http_auth_response_provider.h" | 5 #import "ios/web/public/test/http_server/http_auth_response_provider.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "net/http/http_request_headers.h" | 9 #include "net/http/http_request_headers.h" |
10 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
11 | 11 |
12 namespace web { | 12 namespace web { |
13 | 13 |
14 HttpAuthResponseProvider::HttpAuthResponseProvider(const GURL& url, | 14 HttpAuthResponseProvider::HttpAuthResponseProvider(const GURL& url, |
15 const std::string& realm, | 15 const std::string& realm, |
(...skipping 28 matching lines...) Expand all Loading... |
44 std::string auth = | 44 std::string auth = |
45 base::StringPrintf("%s:%s", username_.c_str(), password_.c_str()); | 45 base::StringPrintf("%s:%s", username_.c_str(), password_.c_str()); |
46 std::string encoded_auth; | 46 std::string encoded_auth; |
47 base::Base64Encode(auth, &encoded_auth); | 47 base::Base64Encode(auth, &encoded_auth); |
48 return header == base::StringPrintf("Basic %s", encoded_auth.c_str()); | 48 return header == base::StringPrintf("Basic %s", encoded_auth.c_str()); |
49 } | 49 } |
50 return false; | 50 return false; |
51 } | 51 } |
52 | 52 |
53 } // namespace web | 53 } // namespace web |
OLD | NEW |