Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
fix: double slash in fetch backend path construction (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib authored Apr 3, 2020
1 parent 04f1efb commit 33373af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/backends/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class FetchClient {
http (options) {
const body = JSON.stringify(options.body)
const url = new URL(this.url)
url.pathname += options.pathname
// trim trailing slashes
url.pathname = url.pathname.replace(/\/$/, '') + options.pathname
const searchParams = new URLSearchParams(options.parameters || options.qs)
url.search = searchParams

Expand Down

0 comments on commit 33373af

Please sign in to comment.