MCPcopy Index your code
hub / github.com/VictoriaMetrics/VictoriaLogs / GetQuotedRemoteAddr

Function GetQuotedRemoteAddr

lib/httpserver/httpserver.go:566–573  ·  view source on GitHub ↗

GetQuotedRemoteAddr returns quoted remote address.

(r *http.Request)

Source from the content-addressed store, hash-verified

564
565// GetQuotedRemoteAddr returns quoted remote address.
566func GetQuotedRemoteAddr(r *http.Request) string {
567 remoteAddr := r.RemoteAddr
568 if addr := r.Header.Get("X-Forwarded-For"); addr != "" {
569 remoteAddr += ", X-Forwarded-For: " + addr
570 }
571 // quote remoteAddr and X-Forwarded-For, since they may contain untrusted input
572 return stringsutil.JSONString(remoteAddr)
573}
574
575type responseWriterWithAbort struct {
576 http.ResponseWriter

Callers 12

RequestHandlerFunction · 0.92
QueryHandlerFunction · 0.92
queryRangeHandlerFunction · 0.92
GetCommonParamsFunction · 0.92
RequestHandlerFunction · 0.92
handleJournaldFunction · 0.92
RequestHandlerFunction · 0.92
tryProcessingRequestFunction · 0.92
incRequestConcurrencyFunction · 0.92
TestGetQuotedRemoteAddrFunction · 0.85
ErrorfFunction · 0.85
LogErrorFunction · 0.85

Calls 2

JSONStringFunction · 0.92
GetMethod · 0.45

Tested by 1

TestGetQuotedRemoteAddrFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…