Skip to content

Commit

Permalink
Merge pull request #883 from ShuBo6/main
Browse files Browse the repository at this point in the history
fix the error of using path as filepath
  • Loading branch information
Mzack9999 authored May 13, 2024
2 parents cc49e25 + f2513e1 commit be9ffb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/output/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"
"os"
"path"
"path/filepath"
"strings"

"github.com/projectdiscovery/gologger"
Expand Down Expand Up @@ -84,7 +85,7 @@ func storeFields(output *Result, storeFields []string) {
}

func appendToFileField(parsed *url.URL, field, data string) {
file, err := os.OpenFile(path.Join(storeFieldsDirectory, fmt.Sprintf("%s_%s_%s.txt", parsed.Scheme, parsed.Hostname(), field)), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
file, err := os.OpenFile(filepath.Join(storeFieldsDirectory, fmt.Sprintf("%s_%s_%s.txt", parsed.Scheme, parsed.Hostname(), field)), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
return
}
Expand Down

0 comments on commit be9ffb3

Please sign in to comment.