Skip to content

Commit

Permalink
add hex decode
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer committed Jul 6, 2020
1 parent 65500c6 commit f75fe35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/api/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package api

import (
"container/heap"
"encoding/hex"
"fmt"
"net/http"
"net/url"
Expand Down Expand Up @@ -583,7 +584,11 @@ func (h *regionsHandler) AccelerateRegionsScheduleInRange(w http.ResponseWriter,
if !ok {
return "", fmt.Errorf("bad format %s", name)
}
return key, nil
returned, err := hex.DecodeString(key)
if err != nil {
return "", fmt.Errorf("split key %s is not in hex format", name)
}
return string(returned), nil
}

startKey, err := parseKey("start_key", input)
Expand Down

0 comments on commit f75fe35

Please sign in to comment.