mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-12-01 12:13:00 +03:00
logger error message updates:
- missing word in runner.go file errors - various consistency cleanup.
This commit is contained in:
parent
21fa38f079
commit
ad559f308e
@ -60,7 +60,7 @@ func (c *CustomPorts) Set(value string) error {
|
||||
}
|
||||
Ports[p] = protocol
|
||||
} else {
|
||||
gologger.Warning().Msgf("Could not cast port to integer, your value: %s, resulting error %s. Skipping it\n",
|
||||
gologger.Warning().Msgf("Could not cast port to integer from your value: %s. Resulting error: %s. Skipping it.\n",
|
||||
potentialPort, err.Error())
|
||||
}
|
||||
} else {
|
||||
@ -68,21 +68,21 @@ func (c *CustomPorts) Set(value string) error {
|
||||
var lowP, highP int
|
||||
lowP, err := strconv.Atoi(potentialRange[0])
|
||||
if err != nil {
|
||||
gologger.Warning().Msgf("Could not cast first port of your port range(%s) to integer, your value: %s, resulting error %s. Skipping it\n",
|
||||
gologger.Warning().Msgf("Could not cast first port of your range(%s) to integer from your value: %s. Resulting error: %s. Skipping it.\n",
|
||||
potentialPort, potentialRange[0], err.Error())
|
||||
continue
|
||||
}
|
||||
highP, err = strconv.Atoi(potentialRange[1])
|
||||
if err != nil {
|
||||
gologger.Warning().Msgf("Could not cast last port of your port range(%s) to integer, "+
|
||||
"your value: %s, resulting error %s. Skipping it\n",
|
||||
gologger.Warning().Msgf("Could not cast last port of your port range(%s) to integer from "+
|
||||
"your value: %s. Resulting error %s. Skipping it\n",
|
||||
potentialPort, potentialRange[1], err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
if lowP > highP {
|
||||
gologger.Warning().Msgf("first value of port range should be lower than the last part port "+
|
||||
"in that range, your range: [%d, %d]. Skipping it\n",
|
||||
gologger.Warning().Msgf("First value of port range should be lower than the last port "+
|
||||
"from your range: [%d, %d]. Skipping it.\n",
|
||||
lowP, highP)
|
||||
continue
|
||||
}
|
||||
|
@ -19,6 +19,6 @@ func showBanner() {
|
||||
gologger.Print().Msgf("%s\n", banner)
|
||||
gologger.Print().Msgf("\t\tprojectdiscovery.io\n\n")
|
||||
|
||||
gologger.Print().Msgf("Use with caution. You are responsible for your actions\n")
|
||||
gologger.Print().Msgf("Use with caution. You are responsible for your actions.\n")
|
||||
gologger.Print().Msgf("Developers assume no liability and are not responsible for any misuse or damage.\n")
|
||||
}
|
||||
|
@ -292,11 +292,11 @@ func ParseOptions() *Options {
|
||||
|
||||
func (options *Options) validateOptions() {
|
||||
if options.InputFile != "" && !fileutilz.FileNameIsGlob(options.InputFile) && !fileutil.FileExists(options.InputFile) {
|
||||
gologger.Fatal().Msgf("File %s does not exist!\n", options.InputFile)
|
||||
gologger.Fatal().Msgf("File %s does not exist.\n", options.InputFile)
|
||||
}
|
||||
|
||||
if options.InputRawRequest != "" && !fileutil.FileExists(options.InputRawRequest) {
|
||||
gologger.Fatal().Msgf("File %s does not exist!\n", options.InputRawRequest)
|
||||
gologger.Fatal().Msgf("File %s does not exist.\n", options.InputRawRequest)
|
||||
}
|
||||
|
||||
var err error
|
||||
|
@ -135,7 +135,7 @@ func New(options *Options) (*Runner, error) {
|
||||
var rawRequest []byte
|
||||
rawRequest, err = ioutil.ReadFile(options.InputRawRequest)
|
||||
if err != nil {
|
||||
gologger.Fatal().Msgf("Could not read raw request from '%s': %s\n", options.InputRawRequest, err)
|
||||
gologger.Fatal().Msgf("Could not read raw request from path '%s': %s\n", options.InputRawRequest, err)
|
||||
}
|
||||
|
||||
rrMethod, rrPath, rrHeaders, rrBody, errParse := httputilz.ParseRequest(string(rawRequest), options.Unsafe)
|
||||
@ -265,11 +265,11 @@ func (r *Runner) prepareInput() {
|
||||
if fileutil.FileExists(r.options.InputFile) {
|
||||
finput, err := os.Open(r.options.InputFile)
|
||||
if err != nil {
|
||||
gologger.Fatal().Msgf("Could read input file '%s': %s\n", r.options.InputFile, err)
|
||||
gologger.Fatal().Msgf("Could not read input file '%s': %s\n", r.options.InputFile, err)
|
||||
}
|
||||
numHosts, err = r.loadAndCloseFile(finput)
|
||||
if err != nil {
|
||||
gologger.Fatal().Msgf("Could read input file '%s': %s\n", r.options.InputFile, err)
|
||||
gologger.Fatal().Msgf("Could not read input file '%s': %s\n", r.options.InputFile, err)
|
||||
}
|
||||
} else if r.options.InputFile != "" {
|
||||
files, err := fileutilz.ListFilesWithPattern(r.options.InputFile)
|
||||
@ -279,11 +279,11 @@ func (r *Runner) prepareInput() {
|
||||
for _, file := range files {
|
||||
finput, err := os.Open(file)
|
||||
if err != nil {
|
||||
gologger.Fatal().Msgf("Could read input file '%s': %s\n", r.options.InputFile, err)
|
||||
gologger.Fatal().Msgf("Could not read input file '%s': %s\n", r.options.InputFile, err)
|
||||
}
|
||||
numTargetsFile, err := r.loadAndCloseFile(finput)
|
||||
if err != nil {
|
||||
gologger.Fatal().Msgf("Could read input file '%s': %s\n", r.options.InputFile, err)
|
||||
gologger.Fatal().Msgf("Could not read input file '%s': %s\n", r.options.InputFile, err)
|
||||
}
|
||||
numHosts += numTargetsFile
|
||||
}
|
||||
@ -291,7 +291,7 @@ func (r *Runner) prepareInput() {
|
||||
if fileutil.HasStdin() {
|
||||
numTargetsStdin, err := r.loadAndCloseFile(os.Stdin)
|
||||
if err != nil {
|
||||
gologger.Fatal().Msgf("Could read input from stdin: %s\n", err)
|
||||
gologger.Fatal().Msgf("Could not read input from stdin: %s\n", err)
|
||||
}
|
||||
numHosts += numTargetsStdin
|
||||
}
|
||||
@ -303,7 +303,7 @@ func (r *Runner) prepareInput() {
|
||||
r.stats.AddCounter("requests", 0)
|
||||
err := r.stats.Start(makePrintCallback(), time.Duration(statsDisplayInterval)*time.Second)
|
||||
if err != nil {
|
||||
gologger.Warning().Msgf("Could not create statistic: %s\n", err)
|
||||
gologger.Warning().Msgf("Could not create statistics: %s\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1026,14 +1026,14 @@ retry:
|
||||
}
|
||||
writeErr := ioutil.WriteFile(responsePath, []byte(respRaw), 0644)
|
||||
if writeErr != nil {
|
||||
gologger.Warning().Msgf("Could not write response, at path '%s', to disk: %s", responsePath, writeErr)
|
||||
gologger.Warning().Msgf("Could not write response at path '%s', to disk: %s", responsePath, writeErr)
|
||||
}
|
||||
if scanopts.StoreChain && resp.HasChain() {
|
||||
domainFile = strings.ReplaceAll(domainFile, ".txt", ".chain.txt")
|
||||
responsePath := path.Join(scanopts.StoreResponseDirectory, domainFile)
|
||||
writeErr := ioutil.WriteFile(responsePath, []byte(resp.GetChain()), 0644)
|
||||
if writeErr != nil {
|
||||
gologger.Warning().Msgf("Could not write response, at path '%s', to disk: %s", responsePath, writeErr)
|
||||
gologger.Warning().Msgf("Could not write response at path '%s', to disk: %s", responsePath, writeErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user