Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/types/urlencoded.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ function createQueryParser (options, extended) {
* Get the charset of a request.
*
* @param {object} req
* @returns {string|undefined}
* @api private
*/

function getCharset (req) {
try {
return (contentType.parse(req).parameters.charset || '').toLowerCase()
} catch (e) {
return contentType.parse(req).parameters.charset?.toLowerCase()
} catch {
return undefined
}
}
Expand Down