-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ResourceController#download : répare réponse HEAD (#3740)
* ResourceController#download : répare réponse HEAD * Refactor: allowlist of forwarded headers
- Loading branch information
1 parent
bfad9a3
commit c04ccef
Showing
4 changed files
with
52 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
defmodule Shared.Proxy do | ||
@moduledoc """ | ||
Shared methods useful when proxying requests in our apps. | ||
""" | ||
|
||
@doc """ | ||
A list of HTTP headers that will be forwarded by our proxy. | ||
For now we use an allowlist we can gradually expand. | ||
Make sure to avoid including "hop-by-hop" headers here. | ||
https://book.hacktricks.xyz/pentesting-web/abusing-hop-by-hop-headers | ||
""" | ||
def forwarded_headers_allowlist do | ||
[ | ||
"content-type", | ||
"content-length", | ||
"date", | ||
"last-modified", | ||
"etag" | ||
] | ||
end | ||
end |
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