1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-14 11:23:02 +02:00

fix --param handling

When params is converted to map it uses strings.Split,
which slices a string into all substrings separated by :.
This commit is contained in:
Владимир Фетисов 2019-04-10 21:05:21 +03:00
parent 67ce32b8f6
commit d39bb94a4b
2 changed files with 2 additions and 2 deletions

View File

@ -539,5 +539,5 @@ LET c = COOKIES_GET(doc, "baz")
FOR cookie IN doc.cookies
RETURN cookie.name
```

View File

@ -29,7 +29,7 @@ func (p *Params) ToMap() (map[string]interface{}, error) {
res := make(map[string]interface{})
for _, entry := range *p {
pair := strings.Split(entry, ":")
pair := strings.SplitN(entry, ":", 2)
if len(pair) < 2 {
return nil, core.Error(core.ErrInvalidArgument, entry)