Skip to content

Commit 6ad2943

Browse files
authored
docs: update EXCLUDE_HEADERS documentation (#159)
1 parent c86dfa0 commit 6ad2943

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,22 @@ public internet, consider tuning it appropriately:
163163

164164
5. **Prevent leaking sensitive headers**
165165

166-
By default, go-httpbin will return any headers sent by the client in the response.
167-
But if you want to deploy go-httpbin in some serverless environment, you may want to drop some headers.
168-
You can use the `-exclude-headers` CLI argument or the `EXCLUDE_HEADERS` env var to configure an appropriate allowlist.
169-
For example, Alibaba Cloud Function Compute will [add some headers like `x-fc-*` to the request](https://www.alibabacloud.com/help/en/fc/user-guide/specification-details). if you want to drop these `x-fc-*` headers, you can set `EXCLUDE_HEADERS=x-fc-*`.
166+
By default, go-httpbin will return any request headers sent by the client
167+
(and any intermediate proxies) in the response. If go-httpbin is deployed
168+
into an environment where some incoming request headers might reveal
169+
sensitive information, use the `-exclude-headers` CLI argument or
170+
`EXCLUDE_HEADERS` env var to configure a denylist of sensitive header keys.
171+
172+
For example, the Alibaba Cloud Function Compute platform adds
173+
[a variety of `x-fc-*` headers][alibaba-headers] to each incoming request,
174+
some of which might be sensitive. To have go-httpbin filter **all** of these
175+
headers in its own responses, set:
176+
177+
EXCLUDE_HEADERS="x-fc-*"
178+
179+
To have go-httpbin filter only specific headers, you can get more specific:
180+
181+
EXCLUDE_HEADERS="x-fc-access-key-*,x-fc-security-token,x-fc-region"
170182

171183
## Development
172184

@@ -210,3 +222,4 @@ Compared to [ahmetb/go-httpbin][ahmet]:
210222
[Production considerations]: #production-considerations
211223
[zerolog]: https://github.com/rs/zerolog
212224
[DEVELOPMENT.md]: ./DEVELOPMENT.md
225+
[alibaba-headers]: https://www.alibabacloud.com/help/en/fc/user-guide/specification-details#section-3f8-5y1-i77

0 commit comments

Comments
 (0)