Skip to content

Commit b18ada6

Browse files
authored
Merge pull request #29 from projectdiscovery/bugfix-app-crash
fixing crash
2 parents 38b760a + 0712f0b commit b18ada6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/httpserver/httpserver.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ func New(options *Options) (*HTTPServer, error) {
3232
var h HTTPServer
3333
EnableUpload = options.EnableUpload
3434
EnableVerbose = options.Verbose
35-
layers := h.loglayer(http.FileServer(http.Dir(options.Folder)))
35+
h.layers = h.loglayer(http.FileServer(http.Dir(options.Folder)))
3636
if options.BasicAuthUsername != "" || options.BasicAuthPassword != "" {
37-
layers = h.loglayer(h.basicauthlayer(http.FileServer(http.Dir(options.Folder))))
37+
h.layers = h.loglayer(h.basicauthlayer(http.FileServer(http.Dir(options.Folder))))
3838
}
39+
h.options = options
3940

40-
return &HTTPServer{options: options, layers: layers}, nil
41+
return &h, nil
4142
}
4243

4344
// ListenAndServe requests over http

0 commit comments

Comments
 (0)