Skip to content

Commit

Permalink
Support 5, 6, and 7 versions of symfony/yaml (#467)
Browse files Browse the repository at this point in the history
* symfony/yaml bump

* Or constraint

* orchestra/testbench phpunit integration ::getAnnotations() call fix

* Deprecated Request::HEADER_X_FORWARDED_ALL usage
  • Loading branch information
vaawebdev authored Apr 27, 2022
1 parent 9532688 commit e65fa1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"laravel/framework": "^9.0 || >=8.40.0 || ^7.0",
"zircote/swagger-php": "^3.2 || ^4.0",
"swagger-api/swagger-ui": "^3.0 || ^4.0",
"symfony/yaml": "^5.0",
"symfony/yaml": "^5.0 || ^6.0",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"mockery/mockery": "1.*",
"orchestra/testbench": "6.* || 5.*",
"orchestra/testbench": "7.* || ^6.15 || 5.*",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
Expand Down
9 changes: 8 additions & 1 deletion src/Http/Controllers/SwaggerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ public function api(Request $request)
if (! is_array($proxy)) {
$proxy = [$proxy];
}
Request::setTrustedProxies($proxy, Request::HEADER_X_FORWARDED_ALL);
Request::setTrustedProxies(
$proxy,
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB
);
}

$urlToDocs = $this->generateDocumentationFileURL($documentation, $config);
Expand Down

0 comments on commit e65fa1b

Please sign in to comment.