File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
framework/Magento/TestFramework/TestCase/GraphQl
testsuite/Magento/GraphQl Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ private function processResponseHeaders(string $headers): array
213
213
214
214
$ headerLines = preg_split ('/((\r?\n)|(\r\n?))/ ' , $ headers );
215
215
foreach ($ headerLines as $ headerLine ) {
216
- $ headerParts = preg_split ('/:/ ' , $ headerLine );
216
+ $ headerParts = preg_split ('/: / ' , $ headerLine, 2 );
217
217
if (count ($ headerParts ) == 2 ) {
218
218
$ headersArray [trim ($ headerParts [0 ])] = trim ($ headerParts [1 ]);
219
219
} elseif (preg_match ('/HTTP\/[\.0-9]+/ ' , $ headerLine )) {
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public function testCorsHeadersWhenCorsIsEnabled(): void
76
76
$ this ->resourceConfig ->saveConfig (Configuration::XML_PATH_CORS_ALLOWED_HEADERS , 'Origin ' );
77
77
$ this ->resourceConfig ->saveConfig (Configuration::XML_PATH_CORS_ALLOW_CREDENTIALS , '1 ' );
78
78
$ this ->resourceConfig ->saveConfig (Configuration::XML_PATH_CORS_ALLOWED_METHODS , 'GET,POST ' );
79
- $ this ->resourceConfig ->saveConfig (Configuration::XML_PATH_CORS_ALLOWED_ORIGINS , 'magento.local ' );
79
+ $ this ->resourceConfig ->saveConfig (Configuration::XML_PATH_CORS_ALLOWED_ORIGINS , 'http:// magento.local ' );
80
80
$ this ->resourceConfig ->saveConfig (Configuration::XML_PATH_CORS_MAX_AGE , '86400 ' );
81
81
$ this ->reinitConfig ->reinit ();
82
82
@@ -85,7 +85,7 @@ public function testCorsHeadersWhenCorsIsEnabled(): void
85
85
self ::assertEquals ('Origin ' , $ headers ['Access-Control-Allow-Headers ' ]);
86
86
self ::assertEquals ('1 ' , $ headers ['Access-Control-Allow-Credentials ' ]);
87
87
self ::assertEquals ('GET,POST ' , $ headers ['Access-Control-Allow-Methods ' ]);
88
- self ::assertEquals ('magento.local ' , $ headers ['Access-Control-Allow-Origin ' ]);
88
+ self ::assertEquals ('http:// magento.local ' , $ headers ['Access-Control-Allow-Origin ' ]);
89
89
self ::assertEquals ('86400 ' , $ headers ['Access-Control-Max-Age ' ]);
90
90
}
91
91
You can’t perform that action at this time.
0 commit comments