(config: &Config, origin: &str)
| 228 | } |
| 229 | |
| 230 | fn origin_is_allowed(config: &Config, origin: &str) -> bool { |
| 231 | let allowed = [ |
| 232 | format!("http://{}:{}", config.advertise_host, config.http_port), |
| 233 | format!("http://{}:{}", config.bind_ip, config.http_port), |
| 234 | format!("http://localhost:{}", config.http_port), |
| 235 | format!("http://127.0.0.1:{}", config.http_port), |
| 236 | format!("http://[::1]:{}", config.http_port), |
| 237 | ]; |
| 238 | allowed.iter().any(|value| value == origin) |
| 239 | || LAUNCHPAD_ORIGINS.contains(&origin) |
| 240 | || extra_allowed_origins().any(|value| value == "*" || value == origin) |
| 241 | } |
| 242 | |
| 243 | fn origin_is_cors_allowed(config: &Config, origin: &str) -> bool { |
| 244 | origin == "null" || origin_is_allowed(config, origin) |
no test coverage detected