Skip to content

Commit

Permalink
Merge pull request #27 from EverythingMe/remove_extra_unescaping
Browse files Browse the repository at this point in the history
removed extra url-unescaping in http pool
  • Loading branch information
nf committed Jul 7, 2014
2 parents a531d51 + 976d66a commit 0ba15ac
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,8 @@ func (p *HTTPPool) ServeHTTP(w http.ResponseWriter, r *http.Request) {
http.Error(w, "bad request", http.StatusBadRequest)
return
}
groupName, err := url.QueryUnescape(parts[0])
if err != nil {
http.Error(w, "decoding group: "+err.Error(), http.StatusBadRequest)
return
}
key, err := url.QueryUnescape(parts[1])
if err != nil {
http.Error(w, "decoding key: "+err.Error(), http.StatusBadRequest)
return
}
groupName := parts[0]
key := parts[1]

// Fetch the value for this group/key.
group := GetGroup(groupName)
Expand All @@ -133,7 +125,7 @@ func (p *HTTPPool) ServeHTTP(w http.ResponseWriter, r *http.Request) {

group.Stats.ServerRequests.Add(1)
var value []byte
err = group.Get(ctx, key, AllocatingByteSliceSink(&value))
err := group.Get(ctx, key, AllocatingByteSliceSink(&value))
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
Expand Down

0 comments on commit 0ba15ac

Please sign in to comment.