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 604604|
605605*/
606606$ 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()
23332333 }
23342334 }
23352335
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+
23362345 // If the request HTTP method is 'OPTIONS', kill the response and send it to the client
23372346 if ($ this ->input ->method () === 'options ' )
23382347 {
You can’t perform that action at this time.
0 commit comments