mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #2199 from isocolsky/fixed_headers
Read headers in lowercase
This commit is contained in:
commit
a5aaee9abe
|
@ -70,16 +70,24 @@ angular.module('copayApp.services')
|
||||||
if (!headers)
|
if (!headers)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (headers['X-Email-Needs-Validation'])
|
var customHeaders = {};
|
||||||
|
_.each(_.keys(headers), function (headerKey) {
|
||||||
|
var hk = headerKey.toLowerCase();
|
||||||
|
if (hk.indexOf('x-') === 0) {
|
||||||
|
customHeaders[hk] = headers[headerKey];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (customHeaders['x-email-needs-validation'])
|
||||||
$rootScope.needsEmailConfirmation = true;
|
$rootScope.needsEmailConfirmation = true;
|
||||||
else
|
else
|
||||||
$rootScope.needsEmailConfirmation = null;
|
$rootScope.needsEmailConfirmation = null;
|
||||||
|
|
||||||
if (headers['X-Quota-Per-Item'])
|
if (customHeaders['x-quota-per-item'])
|
||||||
$rootScope.quotaPerItem = parseInt(headers['X-Quota-Per-Item']);
|
$rootScope.quotaPerItem = parseInt(customHeaders['x-quota-per-item']);
|
||||||
|
|
||||||
if (headers['X-Quota-Items-Limit'])
|
if (customHeaders['x-quota-items-limit'])
|
||||||
$rootScope.quotaItems = parseInt(headers['X-Quota-Items-Limit']);
|
$rootScope.quotaItems = parseInt(customHeaders['x-quota-items-limit']);
|
||||||
};
|
};
|
||||||
|
|
||||||
root.open = function(email, password, cb) {
|
root.open = function(email, password, cb) {
|
||||||
|
|
Loading…
Reference in New Issue