Skip to content

Commit

Permalink
fixing crash in #27
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Apr 17, 2021
1 parent 38b760a commit 0712f0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/httpserver/httpserver.go
Expand Up @@ -32,12 +32,13 @@ func New(options *Options) (*HTTPServer, error) {
var h HTTPServer
EnableUpload = options.EnableUpload
EnableVerbose = options.Verbose
layers := h.loglayer(http.FileServer(http.Dir(options.Folder)))
h.layers = h.loglayer(http.FileServer(http.Dir(options.Folder)))
if options.BasicAuthUsername != "" || options.BasicAuthPassword != "" {
layers = h.loglayer(h.basicauthlayer(http.FileServer(http.Dir(options.Folder))))
h.layers = h.loglayer(h.basicauthlayer(http.FileServer(http.Dir(options.Folder))))
}
h.options = options

return &HTTPServer{options: options, layers: layers}, nil
return &h, nil
}

// ListenAndServe requests over http
Expand Down

0 comments on commit 0712f0b

Please sign in to comment.