Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add whitelist for custom headers that will be forwarded to the micros… #27

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Modifications for ELA
witschko committed Dec 4, 2019
commit d9192c27614422e6b91c45442db398e9b2883df3
4 changes: 2 additions & 2 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
@@ -36,9 +36,9 @@ public function __construct(Auth $auth)
*/
public function handle(Request $request, Closure $next, $guard = null)
{
if ($this->auth->guard($guard)->guest() && ! app()->environment('local')) {
/*if ($this->auth->guard($guard)->guest() && ! app()->environment('local')) {
return response('Unauthorized.', 401)->header('Access-Control-Allow-Origin', '*');
}
}*/

return $next($request);
}
5 changes: 3 additions & 2 deletions app/Presenters/JSONPresenter.php
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ class JSONPresenter implements PresenterContract
*/
public static function safeDecode($input) {
// Fix for PHP's issue with empty objects
$input = preg_replace('/{\s*}/', "{\"EMPTY_OBJECT\":true}", $input);
//$input = preg_replace('/{\s*}/', "{\"EMPTY_OBJECT\":true}", $input);

return json_decode($input, true);
}
@@ -65,6 +65,7 @@ private function formatString($input)
*/
private function formatArray($input)
{
return self::safeEncode($input);
$output = [];

if (is_array($input) && isset($input['error']) && is_string($input['error'])) {
@@ -81,4 +82,4 @@ private function formatArray($input)

return self::safeEncode($output);
}
}
}
8 changes: 4 additions & 4 deletions ci/site.conf
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@ server {
try_files $uri $uri/ /index.php?$args;

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
Empty file modified storage/app/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/framework/cache/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/framework/views/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/logs/.gitignore
100644 → 100755
Empty file.