x-forwarded-* as rfc and nginx

This commit is contained in:
Jun Kurihara 2022-07-10 01:42:54 +09:00
commit 0c6ffa5e77
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
4 changed files with 56 additions and 39 deletions

View file

@ -157,7 +157,7 @@ where
let headers = response.headers_mut();
remove_hop_header(headers);
remove_connection_header(headers);
append_header_entry(
append_header_entry_with_comma(
headers,
"server",
&format!("{}/{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")),
@ -166,7 +166,7 @@ where
{
if self.globals.http3 {
if let Some(port) = self.globals.https_port {
append_header_entry(
append_header_entry_with_comma(
headers,
header::ALT_SVC.as_str(),
&format!(
@ -208,7 +208,7 @@ where
// delete hop headers including header.connection
remove_hop_header(headers);
// X-Forwarded-For
add_forwarding_header(headers, client_addr, self.tls_enabled)?;
add_forwarding_header(headers, client_addr, self.tls_enabled, &self.globals)?;
// Add te: trailer if te_trailer
if te_trailers {