Skip to content

Commit

Permalink
Expose responseURL on returned response object
Browse files Browse the repository at this point in the history
- so that if a HTTP request result in a redirect, the final url after redirect can be retrieved.
  • Loading branch information
rizdaprasetya committed Mar 31, 2021
1 parent 427969d commit 0fbc06a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const handleSendRequestMessage = async (config: any) => {
status: r.status,
statusText: r.statusText,
headers: r.headers,
responseURL: r.request.responseURL,
data: bufferToBase64(r.data),
timeData: (r.config as any).timeData
},
Expand Down Expand Up @@ -155,6 +156,7 @@ const handleSendRequestMessage = async (config: any) => {
status: res.status,
statusText: res.statusText,
headers: res.headers,
responseURL: res.request.responseURL,
data: res.data,
timeData: (res.config as any).timeData
},
Expand Down

0 comments on commit 0fbc06a

Please sign in to comment.