Closed amanzyuk closed 9 years ago
We need to check Authorization header value in get request. Something like following:
backend.whenGET('/api/', hr).respond( function (method, url, data, headers) { console.log(headers); for (var key in headers) { if (key === 'Authorization') { var val = headers[key]; if (val === 'Token TestToken') { return [200, {}, {}]; } else { console.log('Incorrect token: ' + val); return [401, {}, {}]; } } } return [401, {}, {}]; } );
But headers parameter is undefined.
Fixed in versions 1.2.0 thanks for your's PR
We need to check Authorization header value in get request. Something like following:
But headers parameter is undefined.