diff --git a/lib/request.js b/lib/request.js index 0b0b262..e075cbe 100644 --- a/lib/request.js +++ b/lib/request.js @@ -367,16 +367,12 @@ module.exports = { */ get charset() { - let type = this.get('Content-Type'); - if (!type) return ''; - try { - type = contentType.parse(type); + const { parameters } = contentType.parse(this.req); + return parameters.charset || ''; } catch (e) { return ''; } - - return type.parameters.charset || ''; }, /**