Backed out changeset cc1bac015920 (bug 966560) for xpcshell failures.

This commit is contained in:
Ryan VanderMeulen 2014-01-31 21:00:47 -05:00
parent d48a905e54
commit 721d315595
4 changed files with 4 additions and 21 deletions

View File

@ -194,11 +194,7 @@ HawkClient.prototype = {
};
let request = new HAWKAuthenticatedRESTRequest(uri, credentials, extra);
if (method == "post" || method == "put") {
request[method](payloadObj, onComplete);
} else {
request[method](onComplete);
}
request[method](payloadObj, onComplete);
return deferred.promise;
}

View File

@ -763,25 +763,19 @@ HAWKAuthenticatedRESTRequest.prototype = {
__proto__: RESTRequest.prototype,
dispatch: function dispatch(method, data, onComplete, onProgress) {
let contentType = "text/plain";
if (method == "POST" || method == "PUT") {
contentType = "application/json";
}
if (this.credentials) {
let options = {
now: this.now,
localtimeOffsetMsec: this.localtimeOffsetMsec,
credentials: this.credentials,
payload: data && JSON.stringify(data) || "",
contentType: contentType,
contentType: "application/json; charset=utf-8",
};
let header = CryptoUtils.computeHAWK(this.uri, method, options);
this.setHeader("Authorization", header.field);
this._log.trace("hawk auth header: " + header.field);
}
this.setHeader("Content-Type", contentType);
return RESTRequest.prototype.dispatch.call(
this, method, data, onComplete, onProgress
);

View File

@ -620,13 +620,6 @@ this.FxAccounts.prototype = Object.freeze({
return internal.whenVerified(userData);
},
now: function() {
return internal.now();
},
get localtimeOffsetMsec() {
return internal.localtimeOffsetMsec;
},
/**
* Sign the current user out.

View File

@ -194,11 +194,11 @@ this.BrowserIDManager.prototype = {
* Provide override point for testing token expiration.
*/
_now: function() {
return this._fxaService.now()
return this._fxaService.internal.now()
},
get _localtimeOffsetMsec() {
return this._fxaService.localtimeOffsetMsec;
return this._fxaService.internal.localtimeOffsetMsec;
},
get account() {