Skip to content

Commit

Permalink
Merge pull request #355 from nicksardo/hostname
Browse files Browse the repository at this point in the history
Add host to echo dump
  • Loading branch information
nicksardo authored Jun 21, 2018
2 parents 41b831c + 48ead0c commit d159037
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 d159037

Please sign in to comment.