Skip to content

Commit

Permalink
fix: don't clobber server pathname (#3815)
Browse files Browse the repository at this point in the history
* fix: don't clobber server pathname

The provided server URL may already include a pathname,
so all further segments need to be appended. This also
more closely matches the name `joinURL`.

* add release notes

* use `fs.join` to avoid double slashes
  • Loading branch information
joshyrobot authored Nov 12, 2024
1 parent 3cefd98 commit 2cb668a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/loot-core/src/server/server-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let config: ServerConfig | null = null;

function joinURL(base: string | URL, ...paths: string[]): string {
const url = new URL(base);
url.pathname = fs.join(...paths);
url.pathname = fs.join(url.pathname, ...paths);
return url.toString();
}

Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3815.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [joshyrobot]
---

Allow server URLs to contain pathnames.

0 comments on commit 2cb668a

Please sign in to comment.