tell the relay our server name when we serve responses
This is needed for a future refactor of the relay.main
parent
b1a370385b
commit
5db72be1bc
|
@ -89,7 +89,8 @@ async fn handle_one_req (
|
||||||
{
|
{
|
||||||
let mut resp_req = state.client
|
let mut resp_req = state.client
|
||||||
.post (&format! ("{}/http_response/{}", state.config.relay_url, req_id))
|
.post (&format! ("{}/http_response/{}", state.config.relay_url, req_id))
|
||||||
.header (ptth_core::PTTH_MAGIC_HEADER, base64::encode (rmp_serde::to_vec (&response.parts).map_err (ServerError::MessagePackEncodeResponse)?));
|
.header (ptth_core::PTTH_MAGIC_HEADER, base64::encode (rmp_serde::to_vec (&response.parts).map_err (ServerError::MessagePackEncodeResponse)?))
|
||||||
|
.header ("X-PTTH-SERVER-NAME", &state.config.name);
|
||||||
|
|
||||||
if let Some (length) = response.content_length {
|
if let Some (length) = response.content_length {
|
||||||
resp_req = resp_req.header ("Content-Length", length.to_string ());
|
resp_req = resp_req.header ("Content-Length", length.to_string ());
|
||||||
|
|
Loading…
Reference in New Issue