@faasjs/http 0.0.2-beta.276 → 0.0.2-beta.278
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/lib/index.es.js +8 -5
- package/lib/index.js +8 -5
- package/package.json +2 -2
package/lib/index.es.js
CHANGED
|
@@ -382,7 +382,7 @@ class Http {
|
|
|
382
382
|
this.body = data.event.body;
|
|
383
383
|
this.params = Object.create(null);
|
|
384
384
|
this.response = { headers: Object.create(null) };
|
|
385
|
-
if (data.event.body)
|
|
385
|
+
if (data.event.body) {
|
|
386
386
|
if (data.event.headers && data.event.headers['content-type'] && data.event.headers['content-type'].includes('application/json')) {
|
|
387
387
|
this.logger.debug('[onInvoke] Parse params from json body');
|
|
388
388
|
this.params = JSON.parse(data.event.body);
|
|
@@ -391,15 +391,18 @@ class Http {
|
|
|
391
391
|
this.logger.debug('[onInvoke] Parse params from raw body');
|
|
392
392
|
this.params = data.event.body;
|
|
393
393
|
}
|
|
394
|
+
this.logger.debug('[onInvoke] Params: %j', this.params);
|
|
395
|
+
}
|
|
394
396
|
else if (data.event.queryString) {
|
|
395
397
|
this.logger.debug('[onInvoke] Parse params from queryString');
|
|
396
398
|
this.params = data.event.queryString;
|
|
399
|
+
this.logger.debug('[onInvoke] Params: %j', this.params);
|
|
397
400
|
}
|
|
398
|
-
this.logger.debug('[onInvoke] Params: %j', this.params);
|
|
399
|
-
this.logger.debug('[onInvoke] Parse cookie');
|
|
400
401
|
this.cookie.invoke(this.headers.cookie);
|
|
401
|
-
this.
|
|
402
|
-
|
|
402
|
+
if (this.headers.cookie) {
|
|
403
|
+
this.logger.debug('[onInvoke] Cookie: %j', this.cookie.content);
|
|
404
|
+
this.logger.debug('[onInvoke] Session: %j', this.session.content);
|
|
405
|
+
}
|
|
403
406
|
if (this.validator && data.event.httpMethod) {
|
|
404
407
|
this.logger.debug('[onInvoke] Valid request');
|
|
405
408
|
try {
|
package/lib/index.js
CHANGED
|
@@ -386,7 +386,7 @@ class Http {
|
|
|
386
386
|
this.body = data.event.body;
|
|
387
387
|
this.params = Object.create(null);
|
|
388
388
|
this.response = { headers: Object.create(null) };
|
|
389
|
-
if (data.event.body)
|
|
389
|
+
if (data.event.body) {
|
|
390
390
|
if (data.event.headers && data.event.headers['content-type'] && data.event.headers['content-type'].includes('application/json')) {
|
|
391
391
|
this.logger.debug('[onInvoke] Parse params from json body');
|
|
392
392
|
this.params = JSON.parse(data.event.body);
|
|
@@ -395,15 +395,18 @@ class Http {
|
|
|
395
395
|
this.logger.debug('[onInvoke] Parse params from raw body');
|
|
396
396
|
this.params = data.event.body;
|
|
397
397
|
}
|
|
398
|
+
this.logger.debug('[onInvoke] Params: %j', this.params);
|
|
399
|
+
}
|
|
398
400
|
else if (data.event.queryString) {
|
|
399
401
|
this.logger.debug('[onInvoke] Parse params from queryString');
|
|
400
402
|
this.params = data.event.queryString;
|
|
403
|
+
this.logger.debug('[onInvoke] Params: %j', this.params);
|
|
401
404
|
}
|
|
402
|
-
this.logger.debug('[onInvoke] Params: %j', this.params);
|
|
403
|
-
this.logger.debug('[onInvoke] Parse cookie');
|
|
404
405
|
this.cookie.invoke(this.headers.cookie);
|
|
405
|
-
this.
|
|
406
|
-
|
|
406
|
+
if (this.headers.cookie) {
|
|
407
|
+
this.logger.debug('[onInvoke] Cookie: %j', this.cookie.content);
|
|
408
|
+
this.logger.debug('[onInvoke] Session: %j', this.session.content);
|
|
409
|
+
}
|
|
407
410
|
if (this.validator && data.event.httpMethod) {
|
|
408
411
|
this.logger.debug('[onInvoke] Valid request');
|
|
409
412
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/http",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.278",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"rollup-plugin-typescript2": "*",
|
|
27
27
|
"typescript": "*"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "bd5d012da331ff072eae91c0c006a44248bcc9e2"
|
|
30
30
|
}
|