You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+8
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,7 @@ variables (or a combination of the two):
91
91
|`-max-duration`|`MAX_DURATION`| Maximum duration a response may take | 10s |
92
92
|`-port`|`PORT`| Port to listen on | 8080 |
93
93
|`-use-real-hostname`|`USE_REAL_HOSTNAME`| Expose real hostname as reported by os.Hostname() in the /hostname endpoint | false |
94
+
|`-exclude-headers`|`EXCLUDE_HEADERS`| Drop platform-specific headers. Comma-separated list of headers key to drop, supporting wildcard suffix matching. For example: `"foo,bar,x-fc-*"`| - |
94
95
95
96
**Notes:**
96
97
- Command line arguments take precedence over environment variables.
@@ -159,6 +160,13 @@ public internet, consider tuning it appropriately:
159
160
logging using [zerolog] and further hardens the HTTP server against
160
161
malicious clients by tuning lower-level timeouts and limits.
161
162
163
+
5.**Prevent leaking sensitive headers**
164
+
165
+
By default, go-httpbin will return any headers sent by the client in the response.
166
+
But if you want to deploy go-httpbin in some serverless environment, you may want to drop some headers.
167
+
You can use the `-exclude-headers` CLI argument or the `EXCLUDE_HEADERS` env var to configure an appropriate allowlist.
168
+
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-*`.
0 commit comments