Skip to content

Commit

Permalink
Adding code to assign the last request to axios response
Browse files Browse the repository at this point in the history
  • Loading branch information
rubennorte committed Apr 8, 2017
1 parent e5beab0 commit 84d9a41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,15 @@ module.exports = function httpAdapter(config) {
break;
}

// return the last request in case of redirects
var lastRequest = res.req || req;

var response = {
status: res.statusCode,
statusText: res.statusMessage,
headers: res.headers,
config: config,
request: req
request: lastRequest
};

if (config.responseType === 'stream') {
Expand Down

0 comments on commit 84d9a41

Please sign in to comment.