File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ separate extractors for each proxy / source header.
3535| [ ` XRealIp ` ] | ` X-Real-Ip ` | Nginx |
3636| [ ` ConnectInfo ` ] | N/A (uses socket address) | No proxy, e.g. listening directly to 80 port |
3737
38+ [ ` RightmostForwarded ` ] requires enabling the ` forwarded-header ` feature.
39+
3840## Configurable extractor
3941
4042The configurable extractor assumes initializing [ ` ClientIpSource ` ] at runtime
Original file line number Diff line number Diff line change 1+ #![ cfg_attr( docsrs, feature( doc_cfg) ) ]
12#![ doc = include_str ! ( "../README.md" ) ]
23#[ cfg( feature = "connect-info" ) ]
34use std:: net:: SocketAddr ;
@@ -70,6 +71,9 @@ define_extractor!(
7071#[ cfg( feature = "forwarded-header" ) ]
7172define_extractor ! (
7273 /// Extracts the rightmost IP from `Forwarded` header
74+ ///
75+ /// Requires the `forwarded-header` feature.
76+ #[ cfg_attr( docsrs, doc( cfg( feature = "forwarded-header" ) ) ) ]
7377 RightmostForwarded ,
7478 client_ip:: rightmost_forwarded
7579) ;
@@ -125,7 +129,10 @@ pub enum ClientIpSource {
125129 /// IP from the `Fly-Client-IP` header
126130 FlyClientIp ,
127131 #[ cfg( feature = "forwarded-header" ) ]
128- /// Rightmost IP from the `Forwarded` header
132+ /// Rightmost IP from the `Forwarded` header.
133+ ///
134+ /// Requires the `forwarded-header` feature.
135+ #[ cfg_attr( docsrs, doc( cfg( feature = "forwarded-header" ) ) ) ]
129136 RightmostForwarded ,
130137 /// Rightmost IP from the `X-Forwarded-For` header
131138 RightmostXForwardedFor ,
You can’t perform that action at this time.
0 commit comments