Codebase list golang-github-go-kit-kit / b174c0e
transport/http: PopulateRequestContext Accept Add the request Accept header to the context, under the ContextKeyRequestAccept key. Closes #515. Peter Bourgon 6 years ago
1 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
5959 ContextKeyRequestReferer: r.Header.Get("Referer"),
6060 ContextKeyRequestUserAgent: r.Header.Get("User-Agent"),
6161 ContextKeyRequestXRequestID: r.Header.Get("X-Request-Id"),
62 ContextKeyRequestAccept: r.Header.Get("Accept"),
6263 } {
6364 ctx = context.WithValue(ctx, k, v)
6465 }
116117 // PopulateRequestContext. Its value is r.Header.Get("X-Request-Id").
117118 ContextKeyRequestXRequestID
118119
120 // ContextKeyRequestAccept is populated in the context by
121 // PopulateRequestContext. Its value is r.Header.Get("Accept").
122 ContextKeyRequestAccept
123
119124 // ContextKeyResponseHeaders is populated in the context whenever a
120125 // ServerFinalizerFunc is specified. Its value is of type http.Header, and
121126 // is captured only once the entire response has been written.