File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ unreleased
44* fix: use static exports instead of lazy getters to improve ESM compatibility
55* feat: add subpath exports for individual parsers
66* deps:
7+ * content-type@^2.0.0
78 * http-errors@^2.0.1
89 * iconv-lite^0.7.2
910 * qs@^6.15.0
1011 * raw-body@^3.0.1
12+ * type-is@^2.1.0
1113
12142.2.2 / 2026-01-07
1315=========================
@@ -19,11 +21,11 @@ unreleased
1921=========================
2022
2123* Security fix for [ GHSA-wqch -xfxh-vrr4] ( https://github.com/expressjs/body-parser/security/advisories/GHSA-wqch-xfxh-vrr4 )
22- * deps:
24+ * deps:
2325 * type-is@^2.0.1
2426 * iconv-lite@^0.7.0
2527 * Handle split surrogate pairs when encoding UTF-8
26- * Avoid false positives in ` encodingExists ` by using prototype-less objects
28+ * Avoid false positives in ` encodingExists ` by using prototype-less objects
2729 * raw-body@^3.0.1
2830 * debug@^4.4.3
2931
@@ -117,7 +119,7 @@ This incorporates all changes after 1.19.1 up to 1.20.2.
117119 * deps: qs@6.13.0
118120 * add ` depth ` option to customize the depth level in the parser
119121 * IMPORTANT: The default ` depth ` level for parsing URL-encoded data is now ` 32 ` (previously was ` Infinity ` )
120-
122+
1211231.20.2 / 2023-02-21
122124===================
123125
Original file line number Diff line number Diff line change @@ -25,11 +25,9 @@ module.exports = {
2525 * @private
2626 */
2727function getCharset ( req ) {
28- try {
29- return ( contentType . parse ( req ) . parameters . charset || '' ) . toLowerCase ( )
30- } catch {
31- return undefined
32- }
28+ var header = req . headers [ 'content-type' ]
29+ if ( ! header ) return undefined
30+ return contentType . parse ( header ) . parameters . charset ?. toLowerCase ( )
3331}
3432
3533/**
Original file line number Diff line number Diff line change 2727 },
2828 "dependencies" : {
2929 "bytes" : " ^3.1.2" ,
30- "content-type" : " ^1 .0.5 " ,
30+ "content-type" : " ^2 .0.0 " ,
3131 "debug" : " ^4.4.3" ,
3232 "http-errors" : " ^2.0.1" ,
3333 "iconv-lite" : " ^0.7.2" ,
3434 "on-finished" : " ^2.4.1" ,
3535 "qs" : " ^6.15.0" ,
3636 "raw-body" : " ^3.0.2" ,
37- "type-is" : " ^2.0.1 "
37+ "type-is" : " ^2.1.0 "
3838 },
3939 "devDependencies" : {
4040 "eslint" : " ^8.57.1" ,
You can’t perform that action at this time.
0 commit comments