@whatwg-node/server 0.9.12 → 0.9.13-alpha-20230824092011-9c5bc4c

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.
@@ -34,7 +34,11 @@ function getRequestFromUWSRequest({ req, res, fetchAPI }) {
34
34
  req.forEach((key, value) => {
35
35
  headers.set(key, value);
36
36
  });
37
- const url = `http://localhost${req.getUrl()}`;
37
+ let url = `http://localhost${req.getUrl()}`;
38
+ const query = req.getQuery();
39
+ if (query) {
40
+ url += `?${query}`;
41
+ }
38
42
  return new fetchAPI.Request(url, {
39
43
  method,
40
44
  headers,
@@ -30,7 +30,11 @@ export function getRequestFromUWSRequest({ req, res, fetchAPI }) {
30
30
  req.forEach((key, value) => {
31
31
  headers.set(key, value);
32
32
  });
33
- const url = `http://localhost${req.getUrl()}`;
33
+ let url = `http://localhost${req.getUrl()}`;
34
+ const query = req.getQuery();
35
+ if (query) {
36
+ url += `?${query}`;
37
+ }
34
38
  return new fetchAPI.Request(url, {
35
39
  method,
36
40
  headers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/server",
3
- "version": "0.9.12",
3
+ "version": "0.9.13-alpha-20230824092011-9c5bc4c",
4
4
  "description": "Fetch API compliant HTTP Server adapter",
5
5
  "sideEffects": false,
6
6
  "dependencies": {
@@ -3,6 +3,7 @@ export interface UWSRequest {
3
3
  getMethod(): string;
4
4
  forEach(callback: (key: string, value: string) => void): void;
5
5
  getUrl(): string;
6
+ getQuery(): string;
6
7
  getHeader(key: string): string | undefined;
7
8
  setYield(y: boolean): void;
8
9
  }
@@ -3,6 +3,7 @@ export interface UWSRequest {
3
3
  getMethod(): string;
4
4
  forEach(callback: (key: string, value: string) => void): void;
5
5
  getUrl(): string;
6
+ getQuery(): string;
6
7
  getHeader(key: string): string | undefined;
7
8
  setYield(y: boolean): void;
8
9
  }