(headers: &HeaderMap)
| 1359 | } |
| 1360 | |
| 1361 | fn request_origin(headers: &HeaderMap) -> Option<String> { |
| 1362 | headers |
| 1363 | .get(header::ORIGIN) |
| 1364 | .and_then(|value| value.to_str().ok()) |
| 1365 | .map(ToOwned::to_owned) |
| 1366 | .or_else(|| { |
| 1367 | headers |
| 1368 | .get(header::HOST) |
| 1369 | .and_then(|value| value.to_str().ok()) |
| 1370 | .map(|host| format!("http://{host}")) |
| 1371 | }) |
| 1372 | } |
| 1373 | |
| 1374 | async fn stream_quality(State(state): State<AppState>) -> Json<Value> { |
| 1375 | json(json_value!(stream_quality_response(&state.config))) |
no test coverage detected