diff options
author | Valery Piashchynski <[email protected]> | 2021-06-03 16:59:10 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-06-03 16:59:10 +0300 |
commit | 063703e96e5f7cee59139e98d446d5577fb5c224 (patch) | |
tree | e669d08cbbafaa5d809bfb870e874d3de4683dad /plugins/http/config | |
parent | 62bbde7936109d18bf1f727974719804dad4c105 (diff) |
- Add internal_error_code option
- Update tests
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/http/config')
-rw-r--r-- | plugins/http/config/http.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/http/config/http.go b/plugins/http/config/http.go index a1c2afa6..f06adc49 100644 --- a/plugins/http/config/http.go +++ b/plugins/http/config/http.go @@ -15,6 +15,9 @@ type HTTP struct { // Host and port to handle as http server. Address string + // InternalErrorCode used to override default 500 (InternalServerError) http code + InternalErrorCode uint64 `mapstructure:"internal_error_code"` + // SSLConfig defines https server options. SSLConfig *SSL `mapstructure:"ssl"` @@ -80,6 +83,10 @@ func (c *HTTP) InitDefaults() error { } } + if c.InternalErrorCode == 0 { + c.InternalErrorCode = 500 + } + if c.HTTP2Config == nil { c.HTTP2Config = &HTTP2{} } |