(message: impl ToString)
| 121 | headers.get(PROTOCOL_HEADER).and_then(|h| h.to_str().ok()) == Some(PROTOCOL_SYNC_V1) |
| 122 | } |
| 123 | fn error(message: impl ToString) -> Response { |
| 124 | reply( |
| 125 | StatusCode::BAD_REQUEST, |
| 126 | message.to_string().into_bytes(), |
| 127 | "text/plain", |
| 128 | ) |
| 129 | } |
| 130 | async fn push(State(endpoint): State<Endpoint>, headers: HeaderMap, body: Bytes) -> Response { |
| 131 | if !supported(&headers) { |
| 132 | return error("acceptance endpoint requires actual binary sync protocol"); |