MCPcopy
hub / github.com/uber/aresdb / GetOrigin

Function GetOrigin

utils/http.go:121–131  ·  view source on GitHub ↗

GetOrigin returns the caller of the request.

(r *http.Request)

Source from the content-addressed store, hash-verified

119
120// GetOrigin returns the caller of the request.
121func GetOrigin(r *http.Request) string {
122 origin := r.Header.Get("RPC-Caller")
123 if origin == "" {
124 origin = r.Header.Get("X-Uber-Origin")
125 }
126
127 if origin == "" {
128 origin = "UNKNOWN"
129 }
130 return origin
131}
132
133// NoopHTTPWrapper does nothing; used for testing
134func NoopHTTPWrapper(h http.HandlerFunc) http.HandlerFunc {

Callers 2

WithMetricsFuncFunction · 0.85
http_test.goFile · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected