|
|
|
@ -467,7 +467,7 @@ async fn handle_all (req: Request <Body>, state: Arc <RelayState>)
|
|
|
|
|
// This is stuff the server can use. Clients can't
|
|
|
|
|
// POST right now
|
|
|
|
|
|
|
|
|
|
return Ok (if let Some (request_code) = prefix_match (path, "/7ZSFUKGV/http_response/") {
|
|
|
|
|
return Ok (if let Some (request_code) = prefix_match ("/7ZSFUKGV/http_response/", path) {
|
|
|
|
|
let request_code = request_code.into ();
|
|
|
|
|
handle_http_response (req, state, request_code).await
|
|
|
|
|
}
|
|
|
|
@ -476,14 +476,14 @@ async fn handle_all (req: Request <Body>, state: Arc <RelayState>)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ok (if let Some (listen_code) = prefix_match (path, "/7ZSFUKGV/http_listen/") {
|
|
|
|
|
Ok (if let Some (listen_code) = prefix_match ("/7ZSFUKGV/http_listen/", path) {
|
|
|
|
|
let api_key = match api_key {
|
|
|
|
|
None => return Ok (error_reply (StatusCode::UNAUTHORIZED, "Can't register as server without an API key")),
|
|
|
|
|
Some (x) => x,
|
|
|
|
|
};
|
|
|
|
|
handle_http_listen (state, listen_code.into (), api_key.as_bytes ()).await
|
|
|
|
|
}
|
|
|
|
|
else if let Some (rest) = prefix_match (path, "/frontend/servers/") {
|
|
|
|
|
else if let Some (rest) = prefix_match ("/frontend/servers/", path) {
|
|
|
|
|
if rest == "" {
|
|
|
|
|
#[derive (Serialize)]
|
|
|
|
|
struct ServerEntry <'a> {
|
|
|
|
|