Skip to content

Commit

Permalink
bugfix - Should not capture headers in the closure
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktrom committed Jul 12, 2017
1 parent f77dbf9 commit 9e5383c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addon/adapters/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1123,12 +1123,12 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, {
hash.data = JSON.stringify(hash.data);
}

let headers = get(this, 'headers');
if (headers !== undefined) {
hash.beforeSend = function (xhr) {
Object.keys(headers).forEach((key) => xhr.setRequestHeader(key, headers[key]));
};
}
hash.beforeSend = (xhr) => {
let headers = get(this, 'headers');
if (headers !== undefined) {
Object.keys(headers).forEach((key) => xhr.setRequestHeader(key, headers[key]));
}
};

return hash;
},
Expand Down

0 comments on commit 9e5383c

Please sign in to comment.