@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johntalton/http-util",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -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 === '') { return }
124
- if(value === undefined || value === '') { return }
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'))