mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-25 21:02:33 +03:00
Remove hardcoded query params in adapter.
This commit is contained in:
parent
862d0ce46f
commit
7c3de6c149
@ -188,11 +188,17 @@ async function render(event, context) {
|
||||
* @returns {{ method: string; hostname: string; query: string; headers: Object; host: string; pathname: string; port: number | null; protocol: string; rawUrl: string; }}
|
||||
*/
|
||||
function reqToJson(req) {
|
||||
const queryString = req.multiValueQueryStringParameters ? Object.entries(req.multiValueQueryStringParameters).reduce(
|
||||
(acc, [key, values]) => {
|
||||
return acc + values.map(value => \`\${encodeURIComponent(key)}=\${encodeURIComponent(value)}\`).join('&')
|
||||
}
|
||||
, "") : '';
|
||||
|
||||
|
||||
return {
|
||||
method: req.httpMethod,
|
||||
hostname: "TODO",
|
||||
// query: req.queryStringParameters, //url.search ? url.search.substring(1) : "",
|
||||
query: "", //url.search ? url.search.substring(1) : "",
|
||||
query: queryString,
|
||||
headers: req.headers,
|
||||
host: "", // TODO
|
||||
pathname: req.path,
|
||||
|
Loading…
Reference in New Issue
Block a user