Skip to content

Set baseURL in interceptors is not working. #949

@Baoyx007

Description

@Baoyx007

#### Summary

set baseURL in interceptors is not working.

const service = axios.create({
  baseURL: 'http://localhost/'
});

service.interceptors.request.use(config => {

  config.baseURL = 'dd'
  console.log(config.url) // output :  http://localhost/././../

  return config;
}, error => {
  // Do something with request error
  console.error(error); // for debug
  Promise.reject(error);
})

#### Context

  • axios version: e.g.: v0.16.2
  • Environment: e.g.: node vv8.0.0, chrome 59.0.3071.86, macOS 10.12

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