mirror of
https://github.com/yunginnanet/HellPot
synced 2024-06-28 08:40:48 +00:00
Logging: fix robots not showing client into
This commit is contained in:
parent
15f1838aa8
commit
4931c51a61
@ -10,6 +10,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func robotsTXT(ctx *fasthttp.RequestCtx) {
|
func robotsTXT(ctx *fasthttp.RequestCtx) {
|
||||||
|
slog := log.With().
|
||||||
|
Str("USERAGENT", string(ctx.UserAgent())).
|
||||||
|
Str("REMOTE_ADDR", remoteAddr).
|
||||||
|
Interface("URL", string(ctx.RequestURI())).Logger()
|
||||||
paths := &strings.Builder{}
|
paths := &strings.Builder{}
|
||||||
paths.WriteString("User-agent: *\r\n")
|
paths.WriteString("User-agent: *\r\n")
|
||||||
for _, p := range config.Paths {
|
for _, p := range config.Paths {
|
||||||
@ -19,11 +23,11 @@ func robotsTXT(ctx *fasthttp.RequestCtx) {
|
|||||||
}
|
}
|
||||||
paths.WriteString("\r\n")
|
paths.WriteString("\r\n")
|
||||||
|
|
||||||
log.Debug().
|
slog.Debug().
|
||||||
Strs("PATHS", config.Paths).
|
Strs("PATHS", config.Paths).
|
||||||
Msg("SERVE_ROBOTS")
|
Msg("SERVE_ROBOTS")
|
||||||
|
|
||||||
if _, err := fmt.Fprintf(ctx, paths.String()); err != nil {
|
if _, err := fmt.Fprintf(ctx, paths.String()); err != nil {
|
||||||
log.Error().Err(err).Msg("SERVE_ROBOTS_ERROR")
|
slog.Error().Err(err).Msg("SERVE_ROBOTS_ERROR")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user