Skip to content

Commit

Permalink
fix: copy url from nativeResponse to response in native-bridge.ts (#6397
Browse files Browse the repository at this point in the history
)
  • Loading branch information
wilgert committed Apr 3, 2023
1 parent 51a548b commit e81a2ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/native-bridge.ts
Expand Up @@ -454,6 +454,15 @@ const initBridge = (w: any): void => {
status: nativeResponse.status,
});

/*
* copy url to response, `cordova-plugin-ionic` uses this url from the response
* we need `Object.defineProperty` because url is an inherited getter on the Response
* see: https://stackoverflow.com/a/57382543
* */
Object.defineProperty(response, 'url', {
value: nativeResponse.url,
});

console.timeEnd(tag);
return response;
} catch (error) {
Expand Down

0 comments on commit e81a2ff

Please sign in to comment.