1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-09 11:42:28 +01:00

Merge branch 'overint-allowCORS'

This commit is contained in:
Chaoyi Zha 2016-09-17 21:20:59 -04:00
commit a164c48708

View File

@ -52,7 +52,8 @@ class ApiController extends Controller {
if ($response_type == 'json') {
return response(json_encode($response))
->header('Content-Type', 'application/json');
->header('Content-Type', 'application/json')
->header('Access-Control-Allow-Origin', '*');
}
else {
if ($plain_text_response) {
@ -61,7 +62,9 @@ class ApiController extends Controller {
}
// assume plain text if json not requested
return response($result)
->header('Content-Type', 'text/plain');
->header('Content-Type', 'text/plain')
->header('Access-Control-Allow-Origin', '*');
}
}
}