File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 604
604
|
605
605
*/
606
606
$ config ['allowed_cors_origins ' ] = [];
607
+
608
+ /*
609
+ |--------------------------------------------------------------------------
610
+ | CORS Forced Headers
611
+ |--------------------------------------------------------------------------
612
+ |
613
+ | If using CORS checks, always include the headers and values specified here
614
+ | in the OPTIONS client preflight.
615
+ | Example:
616
+ | $config['forced_cors_headers'] = [
617
+ | 'Access-Control-Allow-Credentials' => 'true'
618
+ | ];
619
+ |
620
+ | Added because of how Sencha Ext JS framework requires the header
621
+ | Access-Control-Allow-Credentials to be set to true to allow the use of
622
+ | credentials in the REST Proxy.
623
+ | See documentation here:
624
+ | http://docs.sencha.com/extjs/6.5.2/classic/Ext.data.proxy.Rest.html#cfg-withCredentials
625
+ |
626
+ */
627
+ $ config ['forced_cors_headers ' ] = [];
Original file line number Diff line number Diff line change @@ -2333,6 +2333,15 @@ protected function _check_cors()
2333
2333
}
2334
2334
}
2335
2335
2336
+ // If there are headers that should be forced in the CORS check, add them now
2337
+ if (is_array ($ this ->config ->item ('forced_cors_headers ' )))
2338
+ {
2339
+ foreach ($ this ->config ->item ('forced_cors_headers ' ) as $ header => $ value )
2340
+ {
2341
+ header ($ header . ': ' . $ value );
2342
+ }
2343
+ }
2344
+
2336
2345
// If the request HTTP method is 'OPTIONS', kill the response and send it to the client
2337
2346
if ($ this ->input ->method () === 'options ' )
2338
2347
{
You can’t perform that action at this time.
0 commit comments