hermes-web-ui 0.1.0 → 0.1.1

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.
@@ -57,10 +57,16 @@ async function proxyRequest(req, res, reqPath) {
57
57
  delete headers['referer']
58
58
 
59
59
  try {
60
+ const hasBody = req.method !== 'GET' && req.method !== 'HEAD'
61
+ const bodyChunks = hasBody ? [] : null
62
+ if (hasBody) {
63
+ for await (const chunk of req) bodyChunks.push(chunk)
64
+ }
65
+
60
66
  const apiRes = await fetch(url, {
61
67
  method: req.method,
62
68
  headers,
63
- body: req.method !== 'GET' && req.method !== 'HEAD' ? req : undefined,
69
+ body: bodyChunks ? Buffer.concat(bodyChunks) : undefined,
64
70
  })
65
71
 
66
72
  const resHeaders = {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermes-web-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "hermes-web-ui": "./bin/hermes-web-ui.mjs"
@@ -33,4 +33,4 @@
33
33
  "vite": "^8.0.4",
34
34
  "vue-tsc": "^3.2.6"
35
35
  }
36
- }
36
+ }