Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pfappserver utils/api response w/ interceptor mutates after request is made #4121

Closed
satkunas opened this issue Mar 25, 2019 · 2 comments
Closed
Assignees

Comments

@satkunas
Copy link
Contributor

satkunas commented Mar 25, 2019

In reference to the request response parameter below.

apiCall.interceptors.response.use((response) => {

The response from apiCall.interceptors.response.use((response)=>{}) includes the properties baseURL and url. The response from apiCall.interceptors.request.use((response)=>{}) also include a baseURL and url field (). This is also the same for errors apiCall.interceptors.response.use((response)=>{}, (error)=>{}).

However the apiCall.interceptors.request.use response differs from apiCall.interceptors.response.use, where the url contains the full URL (therefore redundantly including baseURL), thus leading to 2 different code paths when determining the full URL by appending baseURL and url together.

  • apiCall.interceptors.request.use: fullURL = baseURL + url
  • apiCall.interceptors.response.use: fullURL = url
@cgx
Copy link
Collaborator

cgx commented Mar 26, 2019

I would assume this is a bug in the Axios library. Maybe the upcoming getUri method will help.

@cgx cgx added this to the +1 (patch release) milestone May 10, 2019
@cgx
Copy link
Collaborator

cgx commented May 30, 2019

Axios v0.19.0 released, getUri doesn't help.

@cgx cgx closed this as completed Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants