-
-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urlencoded: Support iso-8859-1, utf8 sentinel, and numeric entities #326
Merged
wesleytodd
merged 27 commits into
expressjs:2.x
from
papandreou:feature/iso-8859-1/take2
Jul 30, 2024
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
9c3860d
urlencoded, in extended mode: Support iso-8859-1 encoded requests, an…
papandreou 6f5406c
urlencoded: Support an utf8 sentinel to detect the charset.
papandreou cf7807b
Pass the interpretNumericEntities option through to qs.
papandreou 22eb75a
Fix lint
papandreou 5c25f5d
Support charsets, sentinels etc. via custom decoders
papandreou dab286a
Simplify
papandreou e3fca5d
Fix empty parameter issue with utf8Sentinel in simple mode
papandreou 5b39b86
Run all the charset/sentinel tests in both extended and simple modes
papandreou 5daeca8
utf8Sentinel => charsetSentinel
papandreou 0fb82de
Merge branch 'master' into feature/iso-8859-1/take2
papandreou 2ef109f
Update qs to 6.9.1
papandreou d82fe9e
Always use the qs module, even in simple mode
papandreou a0b69dd
Create the simple and extended parser with the same function, reducin…
papandreou 97e574d
Don't mention the querystring module in the README
papandreou 080ba72
Fix lint
papandreou 9e055e2
Merge branch 'feature/qsAlways' into feature/iso-8859-1/take2
papandreou 9644b1c
Merge branch 'master' into feature/qsAlways
papandreou 8853a30
Merge branch 'feature/qsAlways' into feature/iso-8859-1/take2
papandreou ca468d4
Merge branch 'master' into feature/iso-8859-1/take2
papandreou b9645c4
Update qs to 6.9.4
papandreou 097fc97
Consistently call it "utf8 sentinel"
papandreou f4a3bca
Merge branch 'master' into feature/iso-8859-1/take2
papandreou 9a4ebac
Merge branch '2.x' into feature/iso-8859-1/take2
papandreou cbf4cec
Simplify by relying on the qs module's support for detecting the charset
papandreou 97d2044
Simplify further
papandreou 9d47455
Put back debug option
papandreou 44a6aa9
Document that defaultCharset defaults to utf-8
papandreou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -271,6 +271,23 @@ The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)` | |
where `buf` is a `Buffer` of the raw request body and `encoding` is the | ||
encoding of the request. The parsing can be aborted by throwing an error. | ||
|
||
##### defaultCharset | ||
|
||
The default charset to parse as, if not specified in content-type. Must be | ||
either `utf-8` or `iso-8859-1`. Defaults to `utf-8`. | ||
|
||
##### charsetSentinel | ||
|
||
Whether to let the value of the `utf8` parameter take precedence as the charset | ||
selector. It requires the form to contain a parameter named `utf8` with a value | ||
of `✓`. Defaults to `false`. | ||
|
||
##### interpretNumericEntities | ||
|
||
Whether to decode numeric entities such as `☺` when parsing an iso-8859-1 | ||
form. Defaults to `false`. | ||
Comment on lines
+285
to
+288
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this goes along with the other defaultCharset value |
||
|
||
|
||
## Errors | ||
|
||
The middlewares provided by this module create errors using the | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this goes along with
defaultCharset