Skip to content

While calling the API axios adds an extra '/' in request at the end (not base url) #6755

Open
@buhshanpjoshi

Description

Describe the bug

Hey,
If url contains the text 'post' in the url its observed axios is adding extra '/' at the end while calling the api which results into 404 Not found.

e.g. formed url while calling - https://hostname/users/bhushan.joshi@gmail/EMP/temp-auth-method
final url - https://hostname/users/bhushan.joshi@gmail/EMP/temp-auth-method

But when its had 'post' in the url
e.g. formed url while calling - https://hostname/users/bhushan.postel@gmail/EMP/temp-auth-method OR https://hostname/users/bhushan.abcpostxx@gmail/EMP/temp-auth-method
final url - https://hostname/users/bhushan.postel@gmail/EMP/temp-auth-method**/** (adds extra slash in it)

To Reproduce

No response

Code snippet

const response = await endpoint().put(`users/${userId}/${userType}/temp-auth-method`,
    payload,
    { headers: { 'Csrf-Token': 'nocheck' } }
  );

Expected behavior

No response

Axios Version

^0.21.1

Adapter Version

No response

Browser

chrome,IE

Browser Version

No response

Node.js Version

No response

OS

No response

Additional Library Versions

No response

Additional context/Screenshots

No response

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