@johntalton/http-util 5.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/content-type.js +6 -3
package/package.json
CHANGED
package/src/content-type.js
CHANGED
|
@@ -120,11 +120,11 @@ export function parseContentType(contentTypeHeader) {
|
|
|
120
120
|
|
|
121
121
|
for(const parameter of parameterSet) {
|
|
122
122
|
const [ key, value ] = parameter.split(CONTENT_TYPE_SEPARATOR.KVP)
|
|
123
|
-
if(key === undefined || key === '') {
|
|
124
|
-
if(value === undefined || value === '') {
|
|
125
|
-
if(hasSpecialChar(key)) { return }
|
|
123
|
+
if(key === undefined || key === '') { continue }
|
|
124
|
+
if(value === undefined || value === '') { continue }
|
|
126
125
|
|
|
127
126
|
const actualKey = key?.trim().toLowerCase()
|
|
127
|
+
if(hasSpecialChar(actualKey)) { continue }
|
|
128
128
|
|
|
129
129
|
const quoted = (value.at(0) === '"' && value.at(-1) === '"')
|
|
130
130
|
const actualValue = quoted ? value.substring(1, value.length - 1) : value
|
|
@@ -143,3 +143,6 @@ export function parseContentType(contentTypeHeader) {
|
|
|
143
143
|
parameters
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
|
|
147
|
+
//
|
|
148
|
+
// console.log(parseContentType('multipart/form-data; boundary=----WebKitFormBoundaryJZy5maoMBkBMoGjt'))
|