Skip to content

Commit

Permalink
fine
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Jun 17, 2024
1 parent a335815 commit 8627aef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions content/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ export const Server = new class Endpoints {
let query: Record<string, string> = {}
if (request.query) query = {...request.query}
if (request.searchParams) {
query[''] = request.searchParams.toString()
for (const [key, value] of request.searchParams) {
if (value) query[key] = value
if (value) {
query[key] = value
}
else if (!query['']) {
query[''] = key
}
else {
throw new Error(`Ambiguous null-value argument between ${key} and ${query['']}`)
}
}
}
return query
Expand Down

0 comments on commit 8627aef

Please sign in to comment.