@faasjs/http 0.0.5-beta.6 → 1.1.0

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/README.md CHANGED
@@ -8,7 +8,9 @@ FaasJS's http plugin.
8
8
 
9
9
  ## Install
10
10
 
11
- npm install @faasjs/http
11
+ ```sh
12
+ npm install @faasjs/http
13
+ ```
12
14
 
13
15
  ## Modules
14
16
 
package/dist/index.d.mts CHANGED
@@ -185,7 +185,7 @@ declare class Http<TParams extends Record<string, any> = any, TCookie extends Re
185
185
  /**
186
186
  * set header
187
187
  * @param key {string} key
188
- * @param value {*} value
188
+ * @param value {string} value
189
189
  */
190
190
  setHeader(key: string, value: string): Http<TParams, TCookie, TSession>;
191
191
  /**
package/dist/index.d.ts CHANGED
@@ -185,7 +185,7 @@ declare class Http<TParams extends Record<string, any> = any, TCookie extends Re
185
185
  /**
186
186
  * set header
187
187
  * @param key {string} key
188
- * @param value {*} value
188
+ * @param value {string} value
189
189
  */
190
190
  setHeader(key: string, value: string): Http<TParams, TCookie, TSession>;
191
191
  /**
package/dist/index.js CHANGED
@@ -558,9 +558,9 @@ var Http = class {
558
558
  this.response.statusCode = this.response.body ? 200 : 201;
559
559
  this.response.headers = Object.assign(
560
560
  {
561
- "Content-Type": "application/json; charset=utf-8",
562
- "Cache-Control": "no-cache, no-store",
563
- "X-FaasJS-Request-Id": data.logger.label
561
+ "content-type": "application/json; charset=utf-8",
562
+ "cache-control": "no-cache, no-store",
563
+ "x-faasjs-request-id": data.logger.label
564
564
  },
565
565
  this.cookie.headers(),
566
566
  this.response.headers
@@ -597,10 +597,10 @@ var Http = class {
597
597
  /**
598
598
  * set header
599
599
  * @param key {string} key
600
- * @param value {*} value
600
+ * @param value {string} value
601
601
  */
602
602
  setHeader(key, value) {
603
- this.response.headers[key] = value;
603
+ this.response.headers[key.toLowerCase()] = value;
604
604
  return this;
605
605
  }
606
606
  /**
package/dist/index.mjs CHANGED
@@ -556,9 +556,9 @@ var Http = class {
556
556
  this.response.statusCode = this.response.body ? 200 : 201;
557
557
  this.response.headers = Object.assign(
558
558
  {
559
- "Content-Type": "application/json; charset=utf-8",
560
- "Cache-Control": "no-cache, no-store",
561
- "X-FaasJS-Request-Id": data.logger.label
559
+ "content-type": "application/json; charset=utf-8",
560
+ "cache-control": "no-cache, no-store",
561
+ "x-faasjs-request-id": data.logger.label
562
562
  },
563
563
  this.cookie.headers(),
564
564
  this.response.headers
@@ -595,10 +595,10 @@ var Http = class {
595
595
  /**
596
596
  * set header
597
597
  * @param key {string} key
598
- * @param value {*} value
598
+ * @param value {string} value
599
599
  */
600
600
  setHeader(key, value) {
601
- this.response.headers[key] = value;
601
+ this.response.headers[key.toLowerCase()] = value;
602
602
  return this;
603
603
  }
604
604
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/http",
3
- "version": "0.0.5-beta.6",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,12 +22,12 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@faasjs/func": "0.0.5-beta.6",
26
- "@faasjs/logger": "0.0.5-beta.6"
25
+ "@faasjs/func": "1.1.0",
26
+ "@faasjs/logger": "1.1.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@faasjs/func": "0.0.5-beta.6",
30
- "@faasjs/logger": "0.0.5-beta.6"
29
+ "@faasjs/func": "1.1.0",
30
+ "@faasjs/logger": "1.1.0"
31
31
  },
32
32
  "engines": {
33
33
  "npm": ">=9.0.0",