Fix getAndRemoveConfig regex (#708)

* Fix getAndRemoveConfig regex

Update getAndRemoveConfig regular expression for prevent cases, when header has name like "foo::bar::baz".

* Fix wrong regexp

* Fix regex

Ignore `:foo` cases
This commit is contained in:
D.A.Bashkirtsev 2018-12-05 07:29:55 +05:00 committed by cinwell.li
parent 28beff80f7
commit 6ac7bace21

View File

@ -19,7 +19,7 @@ export function getAndRemoveConfig(str = '') {
str = str
.replace(/^'/, '')
.replace(/'$/, '')
.replace(/:([\w-]+)=?([\w-]+)?/g, (m, key, value) => {
.replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g, (m, key, value) => {
config[key] = (value && value.replace(/"/g, '')) || true
return ''
})