Skip to content
Snippets Groups Projects
Commit 48c52c9f authored by ale's avatar ale
Browse files

Fix an error when the Config is nil

parent 06f1625b
Branches
No related tags found
No related merge requests found
......@@ -89,7 +89,7 @@ func (config *ServerConfig) buildHTTPHandler(h http.Handler) (http.Handler, *tls
h = addDefaultHandlers(h)
// Optionally enable compression.
if config.EnableCompression {
if config != nil && config.EnableCompression {
gzwrap, err := gziphandler.GzipHandlerWithOpts(
gziphandler.CompressionLevel(gzipLevel),
gziphandler.MinSize(gzipMinSize),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment