use-http icon indicating copy to clipboard operation
use-http copied to clipboard

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

Open rcronin opened this issue 2 years ago • 0 comments

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

rcronin avatar May 09 '23 20:05 rcronin