Bug 738516 - Auth cache should be set for all requests, not just authenticated requests. r=msamuel

This commit is contained in:
Richard Newman 2012-03-23 11:03:48 -07:00
Родитель 8119425bc1
Коммит f9e0ffdfb3
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -117,8 +117,6 @@ public class BaseResource implements Resource {
* @param credentials a string, "user:pass".
*/
private static void applyCredentials(String credentials, HttpUriRequest request, HttpContext context) {
addAuthCacheToContext(request, context);
Credentials creds = new UsernamePasswordCredentials(credentials);
Header header = BasicScheme.authenticate(creds, "US-ASCII", false);
request.addHeader(header);
@ -144,6 +142,8 @@ public class BaseResource implements Resource {
BaseResource.applyCredentials(credentials, request, context);
}
addAuthCacheToContext(request, context);
HttpParams params = client.getParams();
HttpConnectionParams.setConnectionTimeout(params, delegate.connectionTimeout());
HttpConnectionParams.setSoTimeout(params, delegate.socketTimeout());