Skip to content

axios.create({ baseURL }) ignores baseURL when request path starts with / #2

@Erioluwa-dev

Description

@Erioluwa-dev

Bug: baseURL ignored when request path starts with / in kiattp/axios

Description

When using the kiattp/axios compatibility layer, axios.create({ baseURL }) does not correctly join the baseURL with request paths that start with a leading /.

This behavior differs from the official axios implementation and breaks drop-in compatibility.


Reproduction

import { axios } from 'kiattp/axios'

const client = axios.create({
  baseURL: '/api',
})

// Expected URL: /api/auth/login
// Actual URL: /auth/login (baseURL ignored)

await client.post('/auth/login', {
  email: 'test@test.com',
  password: 'test',
})

Metadata

Metadata

Labels

bugSomething isn't workinggood first issueGood for newcomers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions