File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -323,10 +323,10 @@ impl TryFrom<SecretRuleApiMatchValidation> for SecretRuleMatchValidation {
323323 }
324324 SecretRuleApiMatchValidation :: CUSTOM_HTTP_STRING => Ok (
325325 SecretRuleMatchValidation :: CustomHttp ( SecretRuleMatchValidationHttp {
326- endpoint : value. endpoint . expect ( "no endpoint") ,
326+ endpoint : value. endpoint . ok_or ( "missing endpoint") ? ,
327327 hosts : value. hosts . unwrap_or_default ( ) ,
328328 request_headers : value. request_headers . unwrap_or_default ( ) ,
329- http_method : value. http_method . expect ( "missing http method" ) . into ( ) ,
329+ http_method : value. http_method . ok_or ( "missing http method" ) ? . into ( ) ,
330330 timeout_seconds : value. timeout_seconds ,
331331 valid_http_status_code : value
332332 . valid_http_status_code
Original file line number Diff line number Diff line change @@ -144,7 +144,10 @@ impl TryFrom<&SecretRuleMatchValidation> for MatchValidationType {
144144 request_headers : custom_http. request_headers . clone ( ) ,
145145 valid_http_status_code : valid_ports,
146146 invalid_http_status_code : invalid_ports,
147- timeout_seconds : custom_http. timeout_seconds . unwrap ( ) as u32 ,
147+ timeout_seconds : custom_http
148+ . timeout_seconds
149+ . ok_or ( "missing timeout_seconds" ) ?
150+ as u32 ,
148151 } ) )
149152 }
150153 SecretRuleMatchValidation :: CustomHttpV2 ( custom_http_v2) => {
You can’t perform that action at this time.
0 commit comments