@faasjs/http 0.0.2-beta.385 → 0.0.2-beta.386

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.js CHANGED
@@ -323,7 +323,6 @@ var Validator = class {
323
323
  }
324
324
  if (rule.regexp && (rule.type === "string" || !rule.type) && !rule.regexp.test(value)) {
325
325
  const error = Error(`[${type}] ${baseKey}${key} must match ${rule.regexp}.`);
326
- console.log("--------->22222");
327
326
  if (config.onError) {
328
327
  const res = config.onError(`${type}.rule.regexp`, `${baseKey}${key}`, value);
329
328
  if (res)
@@ -496,7 +495,7 @@ var Http = class {
496
495
  "Content-Type": "application/json; charset=utf-8",
497
496
  "Cache-Control": "no-cache, no-store"
498
497
  }, this.cookie.headers(), this.response.headers);
499
- data.response = this.response;
498
+ data.response = __spreadValues(__spreadValues({}, data.response), this.response);
500
499
  if (process.env.FaasMode === "local") {
501
500
  this.logger.debug("[onInvoke] Response: %j", data.response);
502
501
  return;
@@ -507,6 +506,7 @@ var Http = class {
507
506
  if (!acceptEncoding || !/(br|gzip|deflate)/.test(acceptEncoding))
508
507
  return;
509
508
  const originBody = data.response.body;
509
+ data.response.originBody = originBody;
510
510
  try {
511
511
  if (acceptEncoding.includes("br")) {
512
512
  data.response.headers["Content-Encoding"] = "br";
@@ -520,7 +520,6 @@ var Http = class {
520
520
  } else
521
521
  throw Error("No matched compression.");
522
522
  data.response.isBase64Encoded = true;
523
- data.response.originBody = originBody;
524
523
  } catch (error) {
525
524
  console.error(error);
526
525
  data.response.body = originBody;
package/dist/index.mjs CHANGED
@@ -312,7 +312,6 @@ var Validator = class {
312
312
  }
313
313
  if (rule.regexp && (rule.type === "string" || !rule.type) && !rule.regexp.test(value)) {
314
314
  const error = Error(`[${type}] ${baseKey}${key} must match ${rule.regexp}.`);
315
- console.log("--------->22222");
316
315
  if (config.onError) {
317
316
  const res = config.onError(`${type}.rule.regexp`, `${baseKey}${key}`, value);
318
317
  if (res)
@@ -489,7 +488,7 @@ var Http = class {
489
488
  "Content-Type": "application/json; charset=utf-8",
490
489
  "Cache-Control": "no-cache, no-store"
491
490
  }, this.cookie.headers(), this.response.headers);
492
- data.response = this.response;
491
+ data.response = __spreadValues(__spreadValues({}, data.response), this.response);
493
492
  if (process.env.FaasMode === "local") {
494
493
  this.logger.debug("[onInvoke] Response: %j", data.response);
495
494
  return;
@@ -500,6 +499,7 @@ var Http = class {
500
499
  if (!acceptEncoding || !/(br|gzip|deflate)/.test(acceptEncoding))
501
500
  return;
502
501
  const originBody = data.response.body;
502
+ data.response.originBody = originBody;
503
503
  try {
504
504
  if (acceptEncoding.includes("br")) {
505
505
  data.response.headers["Content-Encoding"] = "br";
@@ -513,7 +513,6 @@ var Http = class {
513
513
  } else
514
514
  throw Error("No matched compression.");
515
515
  data.response.isBase64Encoded = true;
516
- data.response.originBody = originBody;
517
516
  } catch (error) {
518
517
  console.error(error);
519
518
  data.response.body = originBody;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/http",
3
- "version": "0.0.2-beta.385",
3
+ "version": "0.0.2-beta.386",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,8 +22,8 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@faasjs/func": "^0.0.2-beta.385",
26
- "@faasjs/logger": "^0.0.2-beta.385"
25
+ "@faasjs/func": "^0.0.2-beta.386",
26
+ "@faasjs/logger": "^0.0.2-beta.386"
27
27
  },
28
28
  "devDependencies": {
29
29
  "tsup": "*",