Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wjlin0 committed Mar 27, 2023
1 parent b21dbb2 commit f623b5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.3-alpine AS builder
FROM golang:1.19.3 AS builder
RUN go install -v github.com/wjlin0/pathScan@latest

FROM alpine:3.17.1
Expand Down
Binary file modified config/dict.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions pkg/runner/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ func (r *Runner) handlerGetFilePath(filename string) []string {

func (r *Runner) handlerGetTargets() map[string]struct{} {
at := make(map[string]struct{})

// 处理 Url 和 UrlFile
addPathsToSet(r.Cfg.Options.Url, at)
addPathsToSet(r.Cfg.Options.UrlFile, at)
r.addUrlsToSet(r.Cfg.Options.Url, at)
r.addUrlsToSet(r.Cfg.Options.UrlFile, at)

// 处理 UrlRemote
if r.Cfg.Options.UrlRemote != "" {
Expand Down Expand Up @@ -214,7 +213,7 @@ func (r *Runner) addUrlsToSet(urlList []string, urlSet map[string]struct{}) {
}
func (r *Runner) addUrlToSet(u string, urlSet map[string]struct{}) {
u = strings.TrimSpace(u)
if !strings.HasPrefix(u, "http") {
if !((strings.HasPrefix(u, "http") && !strings.HasSuffix(u, "https")) || (strings.HasPrefix(u, "https") && !strings.HasSuffix(u, "http"))) {
u1 := "http://" + u
u2 := "https://" + u
r.addUrlToSet(u1, urlSet)
Expand All @@ -225,4 +224,5 @@ func (r *Runner) addUrlToSet(u string, urlSet map[string]struct{}) {
}
urlSet[u] = struct{}{}
}

}

0 comments on commit f623b5e

Please sign in to comment.