mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-04 06:53:36 +00:00
telemetry: Make http_user_agent a normalized field
This way we store a short 8-byte hash of the UA instead of the full string; exactly the same way we store TLS ClientHello info.
This commit is contained in:
parent
df7cdc3fae
commit
9160789b42
4 changed files with 17 additions and 3 deletions
|
|
@ -65,9 +65,10 @@ func (h *tlsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
h.listener.helloInfosMu.RUnlock()
|
||||
|
||||
ua := r.Header.Get("User-Agent")
|
||||
uaHash := telemetry.FastHash([]byte(ua))
|
||||
|
||||
// report this request's UA in connection with this ClientHello
|
||||
go telemetry.AppendUnique("tls_client_hello_ua:"+caddytls.ClientHelloInfo(info).Key(), ua)
|
||||
go telemetry.AppendUnique("tls_client_hello_ua:"+caddytls.ClientHelloInfo(info).Key(), uaHash)
|
||||
|
||||
var checked, mitm bool
|
||||
if r.Header.Get("X-BlueCoat-Via") != "" || // Blue Coat (masks User-Agent header to generic values)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue