isReplicaRelayRequest returns true when the request was sent by another coderd replica as part of cross-replica streaming. The enterprise chat relay sets X-Coder-Relay-Source-Replica on every request to identify itself.
(r *http.Request)
| 2552 | // enterprise chat relay sets X-Coder-Relay-Source-Replica on every |
| 2553 | // request to identify itself. |
| 2554 | func isReplicaRelayRequest(r *http.Request) bool { |
| 2555 | return r.Header.Get("X-Coder-Relay-Source-Replica") != "" |
| 2556 | } |
| 2557 | |
| 2558 | // IsLocalhost returns true if the host points to the local machine. Intended to |
| 2559 | // be called with `u.Hostname()`. |