File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,7 +114,10 @@ define_extractor!(
114114#[ derive( Debug , Clone , Copy ) ]
115115pub struct ClientIp ( pub IpAddr ) ;
116116
117- /// [`ClientIp`] source configuration
117+ /// [`ClientIp`] source configuration.
118+ ///
119+ /// String parsing and serde use the exact PascalCase variant name, for example
120+ /// `ConnectInfo` or `RightmostXForwardedFor`.
118121#[ non_exhaustive]
119122#[ derive( Clone , Debug , Eq , PartialEq ) ]
120123#[ cfg_attr( feature = "serde" , derive( serde:: Deserialize , serde:: Serialize ) ) ]
@@ -158,7 +161,11 @@ pub struct ParseClientIpSourceError(String);
158161
159162impl fmt:: Display for ParseClientIpSourceError {
160163 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
161- write ! ( f, "Invalid ClientIpSource value {}" , self . 0 )
164+ write ! (
165+ f,
166+ "Invalid ClientIpSource value {}. Expected an exact PascalCase ClientIpSource variant name" ,
167+ self . 0
168+ )
162169 }
163170}
164171
You can’t perform that action at this time.
0 commit comments