Skip to content

Commit

Permalink
Merge pull request #516 from go-kit/populate-request-accept
Browse files Browse the repository at this point in the history
transport/http: PopulateRequestContext Accept
  • Loading branch information
peterbourgon authored Apr 19, 2017
2 parents d0853ee + b174c0e commit b3c024f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions transport/http/request_response_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func PopulateRequestContext(ctx context.Context, r *http.Request) context.Contex
ContextKeyRequestReferer: r.Header.Get("Referer"),
ContextKeyRequestUserAgent: r.Header.Get("User-Agent"),
ContextKeyRequestXRequestID: r.Header.Get("X-Request-Id"),
ContextKeyRequestAccept: r.Header.Get("Accept"),
} {
ctx = context.WithValue(ctx, k, v)
}
Expand Down Expand Up @@ -117,6 +118,10 @@ const (
// PopulateRequestContext. Its value is r.Header.Get("X-Request-Id").
ContextKeyRequestXRequestID

// ContextKeyRequestAccept is populated in the context by
// PopulateRequestContext. Its value is r.Header.Get("Accept").
ContextKeyRequestAccept

// ContextKeyResponseHeaders is populated in the context whenever a
// ServerFinalizerFunc is specified. Its value is of type http.Header, and
// is captured only once the entire response has been written.
Expand Down

0 comments on commit b3c024f

Please sign in to comment.