Skip to content

Commit

Permalink
fix encode problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Mar 18, 2021
1 parent 4201527 commit e858341
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions route_push.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,24 @@ func routeDoPush(c *fiber.Ctx, compat bool) error {
if compat {
params := make(map[string]string)
visitor := func(key, value []byte) {
str, err := url.QueryUnescape(string(value))
if err != nil {
return
}
params[strings.ToLower(string(key))] = str
params[strings.ToLower(string(key))] = string(value)
}
// parse query args (medium priority)
c.Request().URI().QueryArgs().VisitAll(visitor)
// form values
// parse post args
c.Request().PostArgs().VisitAll(visitor)

// parse multipartForm values
form, err := c.Request().MultipartForm()
if err == nil {
for key,val := range form.Value {
if len(val) > 0{
params[key] = val[0]
}
}
}


for key, val := range params {
switch strings.ToLower(string(key)) {
case "device_key":
Expand Down

0 comments on commit e858341

Please sign in to comment.