@momsfriendlydevco/cowboy 1.0.11 → 1.0.13
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/request.js +2 -2
- package/package.json +1 -1
package/lib/request.js
CHANGED
|
@@ -73,7 +73,7 @@ export default class CowboyRequest {
|
|
|
73
73
|
* @returns {Promise} A promise which will resolve when the body has been parsed
|
|
74
74
|
*/
|
|
75
75
|
async parseBody(forceType) {
|
|
76
|
-
let type = (forceType || this.headers['content-type'])
|
|
76
|
+
let type = (forceType || this.headers['content-type'] || '')
|
|
77
77
|
.replace(/^([a-z\-\/]+).*$/, '$1'); // Scrap everything after the mime
|
|
78
78
|
|
|
79
79
|
switch (type) {
|
|
@@ -107,7 +107,7 @@ export default class CowboyRequest {
|
|
|
107
107
|
throw new Error('Invalid text body');
|
|
108
108
|
}
|
|
109
109
|
default:
|
|
110
|
-
debug('
|
|
110
|
+
debug('Empty Body Payload');
|
|
111
111
|
this.body = {};
|
|
112
112
|
}
|
|
113
113
|
}
|