mirror of
https://github.com/aljazceru/njump.git
synced 2026-02-23 15:04:22 +01:00
verbosely log requests to event, profile and relay pages.
This commit is contained in:
@@ -22,6 +22,9 @@ import (
|
||||
func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
code := r.PathValue("code")
|
||||
log.Debug().Str("ip", r.Header.Get("X-Forwarded-For")).
|
||||
Str("user-agent", r.Header.Get("User-Agent")).Str("referer", r.Header.Get("Referer")).
|
||||
Str("code", code).Msg("rendering event")
|
||||
|
||||
isEmbed := r.URL.Query().Get("embed") != ""
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ import (
|
||||
|
||||
func renderProfile(ctx context.Context, r *http.Request, w http.ResponseWriter, code string) {
|
||||
isEmbed := r.URL.Query().Get("embed") != ""
|
||||
log.Debug().Str("ip", r.Header.Get("CF-Connecting-IP")).
|
||||
Str("user-agent", r.Header.Get("User-Agent")).Str("referer", r.Header.Get("Referer")).
|
||||
Str("code", code).Msg("rendering profile")
|
||||
|
||||
isSitemap := false
|
||||
if strings.HasSuffix(code, ".xml") {
|
||||
|
||||
@@ -10,6 +10,9 @@ import (
|
||||
|
||||
func renderRelayPage(w http.ResponseWriter, r *http.Request) {
|
||||
hostname := r.URL.Path[3:]
|
||||
log.Debug().Str("ip", r.Header.Get("CF-Connecting-IP")).
|
||||
Str("user-agent", r.Header.Get("User-Agent")).Str("referer", r.Header.Get("Referer")).
|
||||
Str("hostname", hostname).Msg("rendering relay")
|
||||
|
||||
if strings.HasPrefix(hostname, "wss:/") || strings.HasPrefix(hostname, "ws:/") {
|
||||
hostname = trimProtocolAndEndingSlash(hostname)
|
||||
|
||||
Reference in New Issue
Block a user