#[non_exhaustive]pub enum XForwardedFor {
Verified,
Resolved,
Append,
Preserve,
Remove,
}Expand description
What X-Forwarded-For carries upstream. X-Real-IP and Forwarded
(RFC 7239) from the request reach the upstream only with preserve; in
every other mode they are removed, since they would contradict it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Verified
The verified part of the chain: the resolved client, the trusted
proxies between it and this proxy, then this proxy’s peer
(203.0.113.7, 10.0.0.2, 10.0.0.1). Whatever the client wrote left of
its own address is dropped, so the first element is always the
client, and an upstream walking the list from the right reaches the
same client. Absent when no address resolved.
Resolved
The resolved address alone; absent when none resolved.
Append
The request’s list as it arrived, then this proxy’s peer, as nginx, Envoy, HAProxy and most load balancers append. Its first element is whatever the client wrote.
Preserve
The request’s X-Forwarded-For, X-Real-IP and Forwarded as they
arrived, nothing added. Its first element is whatever the client
wrote.
Remove
No X-Forwarded-For.
Trait Implementations§
Source§impl Clone for XForwardedFor
impl Clone for XForwardedFor
impl Copy for XForwardedFor
Source§impl Debug for XForwardedFor
impl Debug for XForwardedFor
Source§impl Default for XForwardedFor
impl Default for XForwardedFor
Source§impl<'de> Deserialize<'de> for XForwardedFor
impl<'de> Deserialize<'de> for XForwardedFor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for XForwardedFor
Source§impl PartialEq for XForwardedFor
impl PartialEq for XForwardedFor
impl StructuralPartialEq for XForwardedFor
Auto Trait Implementations§
impl Freeze for XForwardedFor
impl RefUnwindSafe for XForwardedFor
impl Send for XForwardedFor
impl Sync for XForwardedFor
impl Unpin for XForwardedFor
impl UnsafeUnpin for XForwardedFor
impl UnwindSafe for XForwardedFor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request