Skip to content

Initial URL with a trailing slash adds double slash on relative urls #389

Description

@rcronin

Describe the bug
When setting url in the initial useFetch with a trailing slash, addition get/post/patch functions where you add more to the URL adds an extra slash, making the request return a 404.

const { get, loading, error } = useFetch('https://google.com/');
await get('test/test1');

URL will resolve to http://google.com//test/test1

To Reproduce
See above

Expected behavior
Would expect the URL to be https://google.com/test/test1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions