Skip to content

Commit 850e06b

Browse files
authored
Merge pull request #33 from projectdiscovery/dev
Minor crash fix
2 parents 38b760a + 4db054d commit 850e06b

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
FROM golang:1.16-alpine AS builder
2-
RUN apk add --no-cache git
1+
FROM golang:1.16-alpine as build-env
32
RUN GO111MODULE=on go get -v github.com/projectdiscovery/simplehttpserver/cmd/simplehttpserver
43

54
FROM alpine:latest
65
RUN apk add --no-cache bind-tools ca-certificates
7-
COPY --from=builder /go/bin/simplehttpserver /usr/local/bin/
8-
9-
ENTRYPOINT ["simplehttpserver"]
6+
COPY --from=build-env /go/bin/simplehttpserver /usr/local/bin/simplehttpserver
7+
ENTRYPOINT ["simplehttpserver"]

internal/runner/banner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const banner = `
88
\__ \/ / __ -__ \/ __ \/ / _ \/ /_/ / / / / / / /_/ / ___/ _ \/ ___/ | / / _ \/ ___/
99
___/ / / / / / / / /_/ / / __/ __ / / / / / / ____(__ ) __/ / | |/ / __/ /
1010
/____/_/_/ /_/ /_/ .___/_/\___/_/ /_/ /_/ /_/ /_/ /____/\___/_/ |___/\___/_/
11-
/_/ - v0.0.2
11+
/_/ - v0.0.3
1212
`
1313

1414
// Version is the current version
15-
const Version = `0.0.2`
15+
const Version = `0.0.3`
1616

1717
// showBanner is used to show the banner to the user
1818
func showBanner() {

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)