True when the Host header names the loopback interface the server binds to * (with or without a port). Anything else means the request reached us under a * name that is not loopback — a rebinding DNS host or a proxy pointed at the * local port — which is the DNS-rebinding / cross-site vector against a * localhost-only service. */
| 1626 | * local port — which is the DNS-rebinding / cross-site vector against a |
| 1627 | * localhost-only service. */ |
| 1628 | static bool host_is_loopback(const char *host) { |
| 1629 | return cbm_http_path_match(host, "localhost") || cbm_http_path_match(host, "localhost:*") || |
| 1630 | cbm_http_path_match(host, "127.0.0.1") || cbm_http_path_match(host, "127.0.0.1:*") || |
| 1631 | cbm_http_path_match(host, "[::1]") || cbm_http_path_match(host, "[::1]:*"); |
| 1632 | } |
| 1633 | |
| 1634 | static void dispatch_request(cbm_http_server_t *srv, cbm_http_conn_t *c, |
| 1635 | const cbm_http_req_t *req) { |
no test coverage detected