Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rest): correctly resolve relative paths in REST requests
Axios seems to have a bug that manifests itself when the baseURL is defined with a path, e.g. https://example.org/api/v1 Then, when an individual request is supposed to be sent to an absolute path, e.g. /secure/oauth, Axios incorrectly resolves this combination as https://example.org/api/v1/secure/oauth instead of https://example.org/secure/oauth This change fixes this behaviour by relying on Nodejs built-in URL resolution: new URL(path, baseURL)
- Loading branch information
Showing
2 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters