Skip to content

Commit

Permalink
Add host to echo dump
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Sardo committed Jun 20, 2018
1 parent 0a8cdd4 commit 48ead0c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/echo/app/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func echo(w http.ResponseWriter, r *http.Request) {
setHeadersFromQueryString(w, r)

var dump = struct {
Host string `json:"host"`
Method string `json:"method"`
URI string `json:"uri"`
HTTPVersion string `json:"httpVersion"`
Expand All @@ -92,6 +93,7 @@ func echo(w http.ResponseWriter, r *http.Request) {
Header map[string][]string `json:"header"`
ServerVersion string `json:"serverVersion"`
}{
Host: r.Host,
Method: r.Method,
URI: r.RequestURI,
HTTPVersion: fmt.Sprintf("%d.%d", r.ProtoMajor, r.ProtoMinor),
Expand Down

0 comments on commit 48ead0c

Please sign in to comment.