Skip to content

Commit 720f143

Browse files
authored
Merge pull request #2468 from reduxjs/revert-2465-feature/utils
2 parents d63dad9 + 3da5d74 commit 720f143

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

packages/toolkit/src/query/tests/utils.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ describe('joinUrls', () => {
8383

8484
expect(joinUrls('', '/banana')).toBe('/banana')
8585
expect(joinUrls('', 'banana')).toBe('banana')
86-
87-
expect(joinUrls('/api', '?foo=bar')).toBe('/api?foo=bar')
8886
})
8987

9088
test('correctly joins variations of absolute urls', () => {
@@ -101,10 +99,6 @@ describe('joinUrls', () => {
10199
expect(joinUrls('https://example.com/api/', '/banana/')).toBe(
102100
'https://example.com/api/banana/'
103101
)
104-
105-
expect(joinUrls('https://example.com/api/', '?foo=bar')).toBe(
106-
'https://example.com/api?foo=bar'
107-
)
108102
})
109103
})
110104

packages/toolkit/src/query/utils/joinUrls.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export function joinUrls(
2020

2121
base = withoutTrailingSlash(base)
2222
url = withoutLeadingSlash(url)
23-
const delimiter = url.startsWith('?') ? '' : '/'
2423

25-
return `${base}${delimiter}${url}`;
24+
return `${base}/${url}`
2625
}

0 commit comments

Comments
 (0)