Skip to content

InternalAxiosRequestConfig in interceptors does not contain baseURL #3154

@salisbury-espinosa

Description

@salisbury-espinosa

Description

const client = createClient(
    createConfig<ClientOptions>({
      baseURL: 'https://test.com/api/',
      throwOnError: true,
    }),
  );

=>
when client is created with createClient a parameter baseURL is passed, but "baseURL": "" in requestConfig in client.instance.interceptors.request.use((requestConfig) => {:

{
  "transitional": {
    "silentJSONParsing": true,
    "forcedJSONParsing": true,
    "clarifyTimeoutError": false
  },
  "adapter": [
    "xhr",
    "http",
    "fetch"
  ],
  "transformRequest": [
    null
  ],
  "transformResponse": [
    null
  ],
  "timeout": 0,
  "xsrfCookieName": "XSRF-TOKEN",
  "xsrfHeaderName": "X-XSRF-TOKEN",
  "maxContentLength": -1,
  "maxBodyLength": -1,
  "env": {},
  "headers": {
    "Accept": "application/json, text/plain, */*",
    "Content-Type": "application/json"
  },
  "baseURL": "",
  "throwOnError": true,
  "responseType": "json",
  "url": "https://test.com/api//v1/some/endpoint",
  "client": {
    "sse": {}
  },

Reproducible example or configuration

https://stackblitz.com/edit/hey-api-client-fetch-example

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Broken or incorrect behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions