Skip to content

config.data has been changed in response interceptor #1386

@rosemalejohn

Description

@rosemalejohn

I am using axios request and response interceptors but it seems response.config.data is not an Object.

Here is my Request interceptor:

config.data is an instance of my Form Object

API.interceptors.request.use((config) => {
  if (config.data instanceof Form) {
    config.data.startProcessing()
  }
  return config
})

Now going to the response interceptor, it seems it is not a Form anymore when it is a string already.

API.interceptors.response.use((response) => {
  // this response.config.data is now a string not my Form object anymore
  if (response.config.data instanceof Form) {
    response.config.data.finishProcessing()
  }
  return response
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions