| 805 | |
| 806 | |
| 807 | Future<Nothing> DockerFetcherPluginProcess::_fetch( |
| 808 | const URI& uri, |
| 809 | const string& directory, |
| 810 | const URI& manifestUri, |
| 811 | const http::Headers& manifestHeaders, |
| 812 | const http::Headers& basicAuthHeaders, |
| 813 | const http::Response& response) |
| 814 | { |
| 815 | if (response.code == http::Status::UNAUTHORIZED) { |
| 816 | // Use the 'Basic' credential to request an auth token by default. |
| 817 | return getAuthHeader(uri.path(), manifestUri, basicAuthHeaders, response) |
| 818 | .then(defer(self(), [=]( |
| 819 | const http::Headers& authHeaders) -> Future<Nothing> { |
| 820 | return curl(manifestUri, manifestHeaders + authHeaders, stallTimeout) |
| 821 | .then(defer(self(), |
| 822 | &Self::__fetch, |
| 823 | uri, |
| 824 | directory, |
| 825 | authHeaders, |
| 826 | lambda::_1)); |
| 827 | })); |
| 828 | } |
| 829 | |
| 830 | return __fetch(uri, directory, basicAuthHeaders, response); |
| 831 | } |
| 832 | |
| 833 | |
| 834 | Future<Nothing> DockerFetcherPluginProcess::__fetch( |
nothing calls this directly
no test coverage detected