Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for presence of X-Forwarded-For and X-Forwarded-Proto HTTP h…
…eaders (#299) * add test for presence of X-Forwarded-For and X-Forwarded-Proto HTTP headers Presence and content of `X-Forwarded-For` and `X-Forwarded-Proto` is checked in requests made to the origin server. * add test for X-Forwarded-Proto for HTTP requests * set X-Forwarded-Proto for requests forwarded to the origin server * use insecure HTTP client for performing test requests Generated cert is not trusted by the test runner. * add comment for parseDumpedHTTPHeadersFromBody * accept ::1 as valid X-Forwarded-For value in tests
- Loading branch information
Showing
5 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Application | ||
def call(env) | ||
status = 200 | ||
headers = { "Content-Type" => "application/json" } | ||
body = [ env.select { |k, v| k.start_with?('HTTP_') }.map { |(k, v)| [k, v].join(' ') }.join("\n") ] | ||
|
||
[status, headers, body] | ||
end | ||
end | ||
|
||
run Application.new |
Empty file.