Skip to content

Commit

Permalink
Fix bug when feature name was query-string encoded
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Baecher committed Feb 22, 2018
1 parent 0eade78 commit a038885
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/feature_resource.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package api

import (
"net/url"

"github.com/DataDog/datadog-go/statsd"
"github.com/MEDIGO/laika/models"
"github.com/MEDIGO/laika/notifier"
Expand All @@ -20,7 +22,10 @@ func NewFeatureResource(store store.Store, stats *statsd.Client, notifier notifi
}

func (r *FeatureResource) Get(c echo.Context) error {
name := c.Param("name")
name, err := url.QueryUnescape(c.Param("name"))
if err != nil {
return BadRequest(c, "Bad feature name")
}

feature, err := r.store.GetFeatureByName(name)
if err != nil {
Expand Down

0 comments on commit a038885

Please sign in to comment.