We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
content-type
1 parent 281a04e commit 5560f72Copy full SHA for 5560f72
lib/request.js
@@ -367,16 +367,12 @@ module.exports = {
367
*/
368
369
get charset() {
370
- let type = this.get('Content-Type');
371
- if (!type) return '';
372
-
373
try {
374
- type = contentType.parse(type);
+ const { parameters } = contentType.parse(this.req);
+ return parameters.charset || '';
375
} catch (e) {
376
return '';
377
}
378
379
- return type.parameters.charset || '';
380
},
381
382
/**
0 commit comments