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
105
105
106
106
private function normalizeOptions (): void
107
107
{
108
- // Transform wildcard pattern
109
- foreach ($ this ->allowedOrigins as $ origin ) {
110
- if (strpos ($ origin , '* ' ) !== false ) {
111
- $ this ->allowedOriginsPatterns [] = $ this ->convertWildcardToPattern ($ origin );
112
- }
113
- }
114
-
115
108
// Normalize case
116
109
$ this ->allowedHeaders = array_map ('strtolower ' , $ this ->allowedHeaders );
117
110
$ this ->allowedMethods = array_map ('strtoupper ' , $ this ->allowedMethods );
@@ -120,6 +113,15 @@ private function normalizeOptions(): void
120
113
$ this ->allowAllOrigins = in_array ('* ' , $ this ->allowedOrigins );
121
114
$ this ->allowAllHeaders = in_array ('* ' , $ this ->allowedHeaders );
122
115
$ 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
+ }
123
125
}
124
126
125
127
/**
You can’t perform that action at this time.
0 commit comments