@@ -76,34 +76,33 @@ fn default_redis_pending_duration_secs() -> u64 {
76
76
45
77
77
}
78
78
79
- fn validate_operational_webhook_url ( url : & Option < String > ) -> Result < ( ) , ValidationError > {
80
- if let Some ( url_str) = url {
81
- match Url :: parse ( url_str) {
82
- Ok ( url) => {
83
- // Verify scheme is http or https
84
- if url. scheme ( ) != "http" && url. scheme ( ) != "https" {
85
- return Err ( validation_error (
86
- Some ( "operational_webhook_address" ) ,
87
- Some ( "URL scheme must be http or https" ) ,
88
- ) ) ;
89
- }
90
-
91
- // Verify there's a host
92
- if url. host ( ) . is_none ( ) {
93
- return Err ( validation_error (
94
- Some ( "operational_webhook_address" ) ,
95
- Some ( "URL must include a valid host" ) ,
96
- ) ) ;
97
- }
79
+ fn validate_operational_webhook_url ( url : & str ) -> Result < ( ) , ValidationError > {
80
+ match Url :: parse ( url) {
81
+ Ok ( url) => {
82
+ // Verify scheme is http or https
83
+ if url. scheme ( ) != "http" && url. scheme ( ) != "https" {
84
+ return Err ( validation_error (
85
+ Some ( "operational_webhook_address" ) ,
86
+ Some ( "URL scheme must be http or https" ) ,
87
+ ) ) ;
98
88
}
99
- Err ( _) => {
89
+
90
+ // Verify there's a host
91
+ if url. host ( ) . is_none ( ) {
100
92
return Err ( validation_error (
101
93
Some ( "operational_webhook_address" ) ,
102
- Some ( "Invalid URL format " ) ,
94
+ Some ( "URL must include a valid host " ) ,
103
95
) ) ;
104
96
}
105
97
}
98
+ Err ( _) => {
99
+ return Err ( validation_error (
100
+ Some ( "operational_webhook_address" ) ,
101
+ Some ( "Invalid URL format" ) ,
102
+ ) ) ;
103
+ }
106
104
}
105
+
107
106
Ok ( ( ) )
108
107
}
109
108
0 commit comments