mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-16 11:37:36 +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:
parent
67ce32b8f6
commit
d39bb94a4b
@ -539,5 +539,5 @@ LET c = COOKIES_GET(doc, "baz")
|
|||||||
|
|
||||||
FOR cookie IN doc.cookies
|
FOR cookie IN doc.cookies
|
||||||
RETURN cookie.name
|
RETURN cookie.name
|
||||||
|
|
||||||
```
|
```
|
||||||
|
2
main.go
2
main.go
@ -29,7 +29,7 @@ func (p *Params) ToMap() (map[string]interface{}, error) {
|
|||||||
res := make(map[string]interface{})
|
res := make(map[string]interface{})
|
||||||
|
|
||||||
for _, entry := range *p {
|
for _, entry := range *p {
|
||||||
pair := strings.Split(entry, ":")
|
pair := strings.SplitN(entry, ":", 2)
|
||||||
|
|
||||||
if len(pair) < 2 {
|
if len(pair) < 2 {
|
||||||
return nil, core.Error(core.ErrInvalidArgument, entry)
|
return nil, core.Error(core.ErrInvalidArgument, entry)
|
||||||
|
Loading…
Reference in New Issue
Block a user