@@ -175,6 +175,63 @@ fn server_plan_rejects_native_http1_route_proxy_candidate_with_route_policy() {
175175 ) ;
176176}
177177
178+ #[ test]
179+ fn server_plan_rejects_native_http1_route_proxy_candidate_with_regex_route ( ) {
180+ let mut config = Config :: default ( ) ;
181+ config. server . regex_enabled = true ;
182+ config. vhosts = vec ! [ VhostConfig {
183+ name: "native.test" . to_owned( ) ,
184+ hosts: vec![ "native.test" . to_owned( ) ] ,
185+ max_request_body_bytes: None ,
186+ access: Default :: default ( ) ,
187+ rate_limit: Default :: default ( ) ,
188+ concurrency: Default :: default ( ) ,
189+ tls: Default :: default ( ) ,
190+ acme_challenge: Default :: default ( ) ,
191+ redirect: Default :: default ( ) ,
192+ proxy: fluxheim_config:: ProxyConfig :: disabled( ) ,
193+ cache: CacheConfig :: default ( ) ,
194+ compression: None ,
195+ headers: Default :: default ( ) ,
196+ php: Default :: default ( ) ,
197+ web: Default :: default ( ) ,
198+ routes: vec![ RouteConfig {
199+ name: "api" . to_owned( ) ,
200+ path_exact: None ,
201+ path_prefix: None ,
202+ path_regex: Some ( "^/api/v[0-9]+/" . to_owned( ) ) ,
203+ methods: Vec :: new( ) ,
204+ fallback: false ,
205+ https_redirect_exempt: false ,
206+ strip_prefix: None ,
207+ rewrite_prefix: None ,
208+ rewrite_template: None ,
209+ max_request_body_bytes: None ,
210+ access: Default :: default ( ) ,
211+ rate_limit: Default :: default ( ) ,
212+ concurrency: Default :: default ( ) ,
213+ grpc: Default :: default ( ) ,
214+ redirect: None ,
215+ proxy: Some ( fluxheim_config:: ProxyConfig {
216+ upstreams: vec![ "127.0.0.1:3002" . to_owned( ) ] ,
217+ ..Default :: default ( )
218+ } ) ,
219+ web: None ,
220+ php: None ,
221+ cache: None ,
222+ compression: None ,
223+ headers: Default :: default ( ) ,
224+ } ] ,
225+ } ] ;
226+
227+ let plan = ServerPlan :: from_config ( & config) . expect ( "valid server plan" ) ;
228+
229+ assert_eq ! (
230+ plan. native_http1_proxy_candidates( ) [ 0 ] . unsupported_reason( ) ,
231+ Some ( NativeHttp1ProxyConfigError :: HttpPolicy )
232+ ) ;
233+ }
234+
178235#[ test]
179236fn server_plan_accepts_native_http1_route_proxy_candidate_with_prefix_rewrite ( ) {
180237 let config = Config {
0 commit comments