Skip to content

Commit

Permalink
Tweaks - swagger security and better header check
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobemerick committed Jun 4, 2016
1 parent a056134 commit 2649728
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
$authHeader = base64_encode("{$auth->username}:{$auth->password}");
$authHeader = "Basic {$authHeader}";

if ($_SERVER['REDIRECT_X_HTTP_AUTHORIZATION']) {
if (!empty($_SERVER['REDIRECT_X_HTTP_AUTHORIZATION'])) {
$req = $req->withHeader('Authorization', $_SERVER['REDIRECT_X_HTTP_AUTHORIZATION']);
}

Expand Down
8 changes: 8 additions & 0 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
"produces": [
"application/json"
],
"schemes": [
"https"
],
"securityDefinitions": {
"basicAuth": {
"type": "basic"
}
},
"paths": {
"/comments": {
"x-swagger-router-controller": "Jacobemerick\\CommentService\\Controller\\Comment",
Expand Down

0 comments on commit 2649728

Please sign in to comment.