2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-14 18:42:33 +03:00

fix(buildFullPath): handle allowAbsoluteUrls: false without baseURL (#6833)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Marc Hassan
2025-03-18 14:01:37 -04:00
committed by GitHub
parent 1e6632cd62
commit f10c2e0de7
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -13,6 +13,10 @@ describe('helpers::buildFullPath', function () {
expect(buildFullPath('https://api.github.com', 'https://api.example.com/users', false)).toBe('https://api.github.com/https://api.example.com/users');
});
it('should not combine the URLs when the requestedURL is absolute, allowAbsoluteUrls is false, and the baseURL is not configured', function () {
expect(buildFullPath(undefined, 'https://api.example.com/users', false)).toBe('https://api.example.com/users');
});
it('should not combine URLs when the baseURL is not configured', function () {
expect(buildFullPath(undefined, '/users')).toBe('/users');
});