Skip to content

Commit

Permalink
Merge pull request #203 from dinn2018/subs
Browse files Browse the repository at this point in the history
feat: support 'x-genesis-id' for query
  • Loading branch information
qianbin authored Jan 9, 2019
2 parents 758fa21 + 6589959 commit 30e4cb3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/thor/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ func handleXGenesisID(h http.Handler, genesisID thor.Bytes32) http.Handler {
expectedID := genesisID.String()
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
actualID := r.Header.Get(headerKey)
if actualID == "" {
actualID = r.URL.Query().Get(headerKey)
}
w.Header().Set(headerKey, expectedID)
if actualID != "" && actualID != expectedID {
io.Copy(ioutil.Discard, r.Body)
Expand Down

0 comments on commit 30e4cb3

Please sign in to comment.