Skip to content

Commit

Permalink
Remove url.origin from url links
Browse files Browse the repository at this point in the history
  • Loading branch information
taras committed Jan 20, 2025
1 parent 6a191b6 commit 01d813e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/links-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function* createSibling(pathname: string): Operation<string> {
const request = yield* CurrentRequest.expect();
const url = new URL(request.url);
url.pathname = join(dirname(url.pathname), pathname);
return url.toString();
return url.toString().replace(url.origin, "");
}

export function createChildURL(prefix?: string) {
Expand All @@ -16,6 +16,6 @@ export function createChildURL(prefix?: string) {
url.pathname = join(
...[url.pathname, prefix, pathname].flatMap((s) => s ? [s] : []),
);
return url.toString();
return url.toString().replace(url.origin, "");
};
}

0 comments on commit 01d813e

Please sign in to comment.