Skip to content

Commit

Permalink
fix: also proxy search params
Browse files Browse the repository at this point in the history
  • Loading branch information
codename-niels committed Aug 14, 2024
1 parent 025eaa6 commit 131bf6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export function proxyHandle(proxy, options = { changeOrigin: true }) {
return async function ({ event, resolve }) {
const { url, request } = event;
const { pathname } = url;
const { pathname, search } = url;

/**
* Find first matching path
Expand All @@ -35,7 +35,7 @@ export function proxyHandle(proxy, options = { changeOrigin: true }) {
* Fetch data from remote server
*/
try {
const response = await fetch(`${proxyTarget}${pathname}`, {
const response = await fetch(`${proxyTarget}${pathname}${search}`, {
redirect: 'manual',
method: request.method,
headers: requestHeaders,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@born05/sveltekit-proxy",
"version": "1.1.2",
"version": "1.1.3",
"description": "A simple way to proxy paths from SvelteKit to a different server.",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit 131bf6a

Please sign in to comment.