Skip to content

Commit

Permalink
Revert "Ensures there is no slash in url before query params"
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Jun 29, 2022
1 parent d63dad9 commit 3da5d74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions packages/toolkit/src/query/tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ describe('joinUrls', () => {

expect(joinUrls('', '/banana')).toBe('/banana')
expect(joinUrls('', 'banana')).toBe('banana')

expect(joinUrls('/api', '?foo=bar')).toBe('/api?foo=bar')
})

test('correctly joins variations of absolute urls', () => {
Expand All @@ -101,10 +99,6 @@ describe('joinUrls', () => {
expect(joinUrls('https://example.com/api/', '/banana/')).toBe(
'https://example.com/api/banana/'
)

expect(joinUrls('https://example.com/api/', '?foo=bar')).toBe(
'https://example.com/api?foo=bar'
)
})
})

Expand Down
3 changes: 1 addition & 2 deletions packages/toolkit/src/query/utils/joinUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function joinUrls(

base = withoutTrailingSlash(base)
url = withoutLeadingSlash(url)
const delimiter = url.startsWith('?') ? '' : '/'

return `${base}${delimiter}${url}`;
return `${base}/${url}`
}

0 comments on commit 3da5d74

Please sign in to comment.