Skip to content

Commit 96fada8

Browse files
committed
Fix charset validation for urlencoded
1 parent debe0a3 commit 96fada8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/types/urlencoded.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ function urlencoded (options) {
3535

3636
var extended = Boolean(opts.extended)
3737
var type = opts.type || 'application/x-www-form-urlencoded'
38-
var charset = opts.charset || 'utf-8'
3938

4039
var queryparse = opts.parser || createQueryParser(opts, extended)
4140

4241
return genericParser(opts, {
4342
type: type,
44-
charset: charset,
43+
44+
charset: function validateCharset (charset) {
45+
return charset === 'utf-8' || charset === 'iso-8859-1'
46+
},
4547

4648
parse: function parse (body, encoding) {
4749
return body.length

0 commit comments

Comments
 (0)