File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,6 @@ private function validateOptions(): void
105105
106106 private function normalizeOptions (): void
107107 {
108- // Transform wildcard pattern
109- foreach ($ this ->allowedOrigins as $ origin ) {
110- if (strpos ($ origin , '* ' ) !== false ) {
111- $ this ->allowedOriginsPatterns [] = $ this ->convertWildcardToPattern ($ origin );
112- }
113- }
114-
115108 // Normalize case
116109 $ this ->allowedHeaders = array_map ('strtolower ' , $ this ->allowedHeaders );
117110 $ this ->allowedMethods = array_map ('strtoupper ' , $ this ->allowedMethods );
@@ -120,6 +113,15 @@ private function normalizeOptions(): void
120113 $ this ->allowAllOrigins = in_array ('* ' , $ this ->allowedOrigins );
121114 $ this ->allowAllHeaders = in_array ('* ' , $ this ->allowedHeaders );
122115 $ this ->allowAllMethods = in_array ('* ' , $ this ->allowedMethods );
116+
117+ // Transform wildcard pattern
118+ if (!$ this ->allowAllOrigins ) {
119+ foreach ($ this ->allowedOrigins as $ origin ) {
120+ if (strpos ($ origin , '* ' ) !== false ) {
121+ $ this ->allowedOriginsPatterns [] = $ this ->convertWildcardToPattern ($ origin );
122+ }
123+ }
124+ }
123125 }
124126
125127 /**
You can’t perform that action at this time.
0 commit comments