Skip to content

Commit

Permalink
fix(cloudflare, lambda): preserve query parameters in url (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlexLichter authored Mar 10, 2021
1 parent 8e0b095 commit b59986d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/entries/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function handleEvent (event) {

const r = await localCall({
event,
url: url.pathname,
url: url.pathname + url.search,
host: url.hostname,
protocol: url.protocol,
headers: event.request.headers,
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/entries/lambda.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import '~polyfill'
import { withQuery } from 'ufo'
import { localCall } from '../server'

export async function handler (event, context) {
const r = await localCall({
event,
url: event.path,
url: withQuery(event.path, event.queryStringParameters),
context,
headers: event.headers,
method: event.httpMethod,
Expand Down

0 comments on commit b59986d

Please sign in to comment.