额,参数解析问题修复

This commit is contained in:
2022-07-21 12:53:40 +08:00
parent aa95b36d6b
commit 15dfa5f1dc
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "yizhi-multipart-reader", "name": "yizhi-multipart-reader",
"version": "1.0.4", "version": "1.0.5",
"description": "", "description": "",
"main": "dist/index.js", "main": "dist/index.js",
"types": "typing/index.d.ts", "types": "typing/index.d.ts",

View File

@ -286,7 +286,7 @@ export class MultipartReader {
items.forEach(item => { items.forEach(item => {
const matchItem = item.match(/^([\s\S]+?)=([\s\S]+?)$/) const matchItem = item.match(/^([\s\S]+?)=([\s\S]+?)$/)
if (!matchItem) return if (!matchItem) return
let [k, v] = matchItem.map(s => s.trim()) let [_, k, v] = matchItem.map(s => s.trim())
k = k.toLowerCase() k = k.toLowerCase()
//去除引号 //去除引号
if (v[0] == '"' && v[v.length - 1] == '"') v = v.substring(1, v.length - 1) if (v[0] == '"' && v[v.length - 1] == '"') v = v.substring(1, v.length - 1)