GetOrigin returns the caller of the request.
(r *http.Request)
| 119 | |
| 120 | // GetOrigin returns the caller of the request. |
| 121 | func 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 |
| 134 | func NoopHTTPWrapper(h http.HandlerFunc) http.HandlerFunc { |
no test coverage detected