@hapi/content
Advanced tools
Comparing version 5.0.2 to 6.0.0
@@ -21,6 +21,9 @@ 'use strict'; | ||
// 1: "b" 2: b | ||
internals.paramsRegex = /;\s*boundary=(?:"([^"]+)"|([^;"\s]+))/i; | ||
// 1: "b" 2: b | ||
internals.charsetParamRegex = /;\s*charset=(?:"([^"]+)"|([^;"\s]+))/i; | ||
// 1: "b" 2: b | ||
internals.boundaryParamRegex = /;\s*boundary=(?:"([^"]+)"|([^;"\s]+))/i; | ||
exports.type = function (header) { | ||
@@ -41,6 +44,13 @@ | ||
const params = match[2]; | ||
if (params) { | ||
const param = params.match(internals.charsetParamRegex); | ||
if (param) { | ||
result.charset = (param[1] || param[2]).toLowerCase(); | ||
} | ||
} | ||
if (result.mime.indexOf('multipart/') === 0) { | ||
const params = match[2]; | ||
if (params) { | ||
const param = params.match(internals.paramsRegex); | ||
const param = params.match(internals.boundaryParamRegex); | ||
if (param) { | ||
@@ -47,0 +57,0 @@ result.boundary = param[1] || param[2]; |
@@ -1,3 +0,4 @@ | ||
Copyright (c) 2014-2020, Sideway Inc, and project contributors | ||
Copyright (c) 2014, Walmart. | ||
Copyright (c) 2014-2022, Project contributors | ||
Copyright (c) 2014-2020, Sideway Inc | ||
Copyright (c) 2014, Walmart. | ||
All rights reserved. | ||
@@ -4,0 +5,0 @@ |
{ | ||
"name": "@hapi/content", | ||
"description": "HTTP Content-* headers parsing", | ||
"version": "5.0.2", | ||
"version": "6.0.0", | ||
"repository": "git://github.com/hapijs/content", | ||
@@ -17,8 +17,14 @@ "main": "lib/index.js", | ||
], | ||
"eslintConfig": { | ||
"extends": [ | ||
"plugin:@hapi/module" | ||
] | ||
}, | ||
"dependencies": { | ||
"@hapi/boom": "9.x.x" | ||
"@hapi/boom": "^10.0.0" | ||
}, | ||
"devDependencies": { | ||
"@hapi/code": "8.x.x", | ||
"@hapi/lab": "22.x.x" | ||
"@hapi/code": "^9.0.0", | ||
"@hapi/eslint-plugin": "*", | ||
"@hapi/lab": "^25.0.1" | ||
}, | ||
@@ -25,0 +31,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7780
104
3
1
+ Added@hapi/boom@10.0.1(transitive)
+ Added@hapi/hoek@11.0.7(transitive)
- Removed@hapi/boom@9.1.4(transitive)
- Removed@hapi/hoek@9.3.0(transitive)
Updated@hapi/boom@^10.0.0