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
feat: allow configuration of underlying http.Server (#199)
Fixes#194, which pointed out that we should allow configuring
additional relevant options on the underlying
[http.Server](https://pkg.go.dev/net/http#Server) without requiring
users to build and push their own images.
Copy file name to clipboardexpand all lines: README.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,7 @@ variables (or a combination of the two):
92
92
| Argument| Env var | Documentation | Default |
93
93
| - | - | - | - |
94
94
|`-allowed-redirect-domains`|`ALLOWED_REDIRECT_DOMAINS`| Comma-separated list of domains the /redirect-to endpoint will allow ||
95
+
|`-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-*"`| - |
95
96
|`-host`|`HOST`| Host to listen on | "0.0.0.0" |
96
97
|`-https-cert-file`|`HTTPS_CERT_FILE`| HTTPS Server certificate file ||
97
98
|`-https-key-file`|`HTTPS_KEY_FILE`| HTTPS Server private key file ||
@@ -100,8 +101,10 @@ variables (or a combination of the two):
100
101
|`-max-duration`|`MAX_DURATION`| Maximum duration a response may take | 10s |
101
102
|`-port`|`PORT`| Port to listen on | 8080 |
102
103
|`-prefix`|`PREFIX`| Prefix of path to listen on (must start with slash and does not end with slash) ||
104
+
|`-srv-max-header-bytes`|`SRV_MAX_HEADER_BYTES`| Value to use for the http.Server's MaxHeaderBytes option | 16384 |
105
+
|`-srv-read-header-timeout`|`SRV_READ_HEADER_TIMEOUT`| Value to use for the http.Server's ReadHeaderTimeout option | 1s |
106
+
|`-srv-read-timeout`|`SRV_READ_TIMEOUT`| Value to use for the http.Server's ReadTimeout option | 5s |
103
107
|`-use-real-hostname`|`USE_REAL_HOSTNAME`| Expose real hostname as reported by os.Hostname() in the /hostname endpoint | false |
104
-
|`-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-*"`| - |
105
108
106
109
**Notes:**
107
110
- Command line arguments take precedence over environment variables.
fs.StringVar(&cfg.TLSKeyFile, "https-key-file", "", "HTTPS Server private key file")
163
166
fs.StringVar(&cfg.ExcludeHeaders, "exclude-headers", "", "Drop platform-specific headers. Comma-separated list of headers key to drop, supporting wildcard matching.")
164
167
fs.StringVar(&cfg.LogFormat, "log-format", defaultLogFormat, "Log format (text or json)")
168
+
fs.IntVar(&cfg.SrvMaxHeaderBytes, "srv-max-header-bytes", defaultSrvMaxHeaderBytes, "Value to use for the http.Server's MaxHeaderBytes option")
169
+
fs.DurationVar(&cfg.SrvReadHeaderTimeout, "srv-read-header-timeout", defaultSrvReadHeaderTimeout, "Value to use for the http.Server's ReadHeaderTimeout option")
170
+
fs.DurationVar(&cfg.SrvReadTimeout, "srv-read-timeout", defaultSrvReadTimeout, "Value to use for the http.Server's ReadTimeout option")
165
171
166
172
// in order to fully control error output whether CLI arguments or env vars
167
173
// are used to configure the app, we need to take control away from the
0 commit comments