h3 0.3.4 → 0.3.5

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.
package/dist/index.cjs CHANGED
@@ -201,6 +201,9 @@ function useRawBody(req, encoding = "utf-8") {
201
201
  if (req[RawBodySymbol]) {
202
202
  return Promise.resolve(encoding ? req[RawBodySymbol].toString(encoding) : req[RawBodySymbol]);
203
203
  }
204
+ if (req._body) {
205
+ return Promise.resolve(req._body);
206
+ }
204
207
  return new Promise((resolve, reject) => {
205
208
  const bodyData = [];
206
209
  req.on("error", (err) => {
package/dist/index.mjs CHANGED
@@ -197,6 +197,9 @@ function useRawBody(req, encoding = "utf-8") {
197
197
  if (req[RawBodySymbol]) {
198
198
  return Promise.resolve(encoding ? req[RawBodySymbol].toString(encoding) : req[RawBodySymbol]);
199
199
  }
200
+ if (req._body) {
201
+ return Promise.resolve(req._body);
202
+ }
200
203
  return new Promise((resolve, reject) => {
201
204
  const bodyData = [];
202
205
  req.on("error", (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h3",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Tiny JavaScript Server",
5
5
  "repository": "unjs/h3",
6
6
  "license": "MIT",