mirror of
https://github.com/aljazceru/njump.git
synced 2026-01-31 11:44:34 +01:00
reorder some calls on renderEvent.
This commit is contained in:
@@ -15,9 +15,6 @@ import (
|
||||
)
|
||||
|
||||
func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Println(r.URL.Path, "#/", r.Header.Get("user-agent"))
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
|
||||
code := r.URL.Path[1:] // hopefully a nip19 code
|
||||
|
||||
// it's the homepage
|
||||
@@ -36,6 +33,8 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(r.URL.Path, "#/", r.Header.Get("user-agent"))
|
||||
|
||||
// force note1 to become nevent1
|
||||
if strings.HasPrefix(code, "note1") {
|
||||
_, redirectHex, err := nip19.Decode(code)
|
||||
@@ -188,6 +187,7 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
// we must do this because inside <blockquotes> we must treat <img>s different when telegram_instant_view
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
if data.templateId == TelegramInstantView {
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
} else if len(data.content) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user