querystring helper for debugging image generation.

This commit is contained in:
fiatjaf
2023-10-10 09:35:47 -03:00
parent e5d37ece3c
commit 75189d8bec
2 changed files with 6 additions and 1 deletions

View File

@@ -136,7 +136,7 @@ func render(w http.ResponseWriter, r *http.Request) {
textImageURL := ""
description := ""
if useTextImage {
textImageURL = fmt.Sprintf("https://%s/njump/image/%s", host, code)
textImageURL = fmt.Sprintf("https://%s/njump/image/%s?%s", host, code, r.URL.RawQuery)
if subject != "" {
if seenOnRelays != "" {
description = fmt.Sprintf("%s -- %s", subject, seenOnRelays)

View File

@@ -160,6 +160,11 @@ func generateClientList(code string, event *nostr.Event) []ClientReference {
}
func getPreviewStyle(r *http.Request) string {
if style := r.URL.Query().Get("style"); style != "" {
// debug mode
return style
}
ua := strings.ToLower(r.Header.Get("User-Agent"))
accept := r.Header.Get("Accept")