@whatwg-node/server 0.6.6 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +5 -2
  2. package/index.mjs +6 -3
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -60,8 +60,11 @@ function normalizeNodeRequest(nodeRequest, RequestCtor) {
60
60
  const rawRequest = nodeRequest.raw || nodeRequest.req || nodeRequest;
61
61
  let fullUrl = buildFullUrl(rawRequest);
62
62
  if (nodeRequest.query) {
63
- const searchParams = new fetch.URLSearchParams(nodeRequest.query);
64
- fullUrl += searchParams.toString();
63
+ const url = new fetch.URL(fullUrl);
64
+ for (const key in nodeRequest.query) {
65
+ url.searchParams.set(key, nodeRequest.query[key]);
66
+ }
67
+ fullUrl = url.toString();
65
68
  }
66
69
  if (nodeRequest.method === 'GET' || nodeRequest.method === 'HEAD') {
67
70
  return new RequestCtor(fullUrl, {
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { URLSearchParams, Request, Response } from '@whatwg-node/fetch';
1
+ import { URL, Request, Response } from '@whatwg-node/fetch';
2
2
  export { Response } from '@whatwg-node/fetch';
3
3
 
4
4
  function isAsyncIterable(body) {
@@ -57,8 +57,11 @@ function normalizeNodeRequest(nodeRequest, RequestCtor) {
57
57
  const rawRequest = nodeRequest.raw || nodeRequest.req || nodeRequest;
58
58
  let fullUrl = buildFullUrl(rawRequest);
59
59
  if (nodeRequest.query) {
60
- const searchParams = new URLSearchParams(nodeRequest.query);
61
- fullUrl += searchParams.toString();
60
+ const url = new URL(fullUrl);
61
+ for (const key in nodeRequest.query) {
62
+ url.searchParams.set(key, nodeRequest.query[key]);
63
+ }
64
+ fullUrl = url.toString();
62
65
  }
63
66
  if (nodeRequest.method === 'GET' || nodeRequest.method === 'HEAD') {
64
67
  return new RequestCtor(fullUrl, {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@whatwg-node/server",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Fetch API compliant HTTP Server adapter",
5
5
  "sideEffects": false,
6
6
  "dependencies": {
7
- "@whatwg-node/fetch": "^0.8.0",
7
+ "@whatwg-node/fetch": "^0.8.1",
8
8
  "tslib": "^2.3.1"
9
9
  },
10
10
  "repository": {