File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,34 @@ public function returnedDataProvider()
317
317
],
318
318
],
319
319
],
320
+ 'domain with www by default ' => [
321
+ 'routes ' => [
322
+ 'http://example.com/ ' => ['original_url ' => 'http://www.{default}/ ' , 'type ' => 'upstream ' ],
323
+ 'https://example.com/ ' => ['original_url ' => 'https://www.{default}/ ' , 'type ' => 'upstream ' ],
324
+ 'http://*.example.com/ ' => ['original_url ' => 'http://*.{default}/ ' , 'type ' => 'upstream ' ],
325
+ 'https://*.example.com/ ' => ['original_url ' => 'https://*.{default}/ ' , 'type ' => 'upstream ' ],
326
+ 'http://french.example.com/ ' => [
327
+ 'original_url ' => 'http://french.{default}/ ' ,
328
+ 'type ' => 'upstream ' ,
329
+ ],
330
+ 'https://french.example.com/ ' => [
331
+ 'original_url ' => 'https://french.{default}/ ' ,
332
+ 'type ' => 'upstream ' ,
333
+ ],
334
+ ],
335
+ [
336
+ 'secure ' => [
337
+ '' => 'https://example.com/ ' ,
338
+ '* ' => 'https://*.example.com/ ' ,
339
+ 'french ' => 'https://french.example.com/ ' ,
340
+ ],
341
+ 'unsecure ' => [
342
+ '' => 'http://example.com/ ' ,
343
+ '* ' => 'http://*.example.com/ ' ,
344
+ 'french ' => 'http://french.example.com/ ' ,
345
+ ],
346
+ ],
347
+ ],
320
348
];
321
349
}
322
350
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ private function parseRoutes(array $routes): array
61
61
}
62
62
63
63
$ host = parse_url ($ val ['original_url ' ], PHP_URL_HOST );
64
- $ originalUrlRegEx = sprintf ('/\.?%s/ ' , preg_quote (self ::MAGIC_ROUTE ));
64
+ $ originalUrlRegEx = sprintf ('/(www)? \.?%s/ ' , preg_quote (self ::MAGIC_ROUTE ));
65
65
$ originalUrl = preg_replace ($ originalUrlRegEx , '' , $ host );
66
66
67
67
if (strpos ($ key , self ::PREFIX_UNSECURE ) === 0 ) {
You can’t perform that action at this time.
0 commit comments