fix nip-05 links again.

This commit is contained in:
fiatjaf
2023-11-23 21:20:41 -03:00
parent 2ba351536f
commit 6574fc3493
2 changed files with 15 additions and 8 deletions

View File

@@ -24,21 +24,22 @@ func renderProfile(w http.ResponseWriter, r *http.Request, code string) {
}
data, err := grabData(r.Context(), code, isSitemap)
if err != nil {
w.Header().Set("Cache-Control", "max-age=60")
} else if len(data.renderableLastNotes) != 0 {
w.Header().Set("Cache-Control", "max-age=3600")
}
if err != nil {
errorPage := &ErrorPage{
Errors: err.Error(),
}
errorPage.TemplateText()
w.WriteHeader(http.StatusNotFound)
ErrorTemplate.Render(w, errorPage)
} else if isSitemap {
return
}
if len(data.renderableLastNotes) != 0 {
w.Header().Set("Cache-Control", "max-age=3600")
}
if isSitemap {
w.Header().Add("content-type", "text/xml")
w.Write([]byte(XML_HEADER))
SitemapTemplate.Render(w, &SitemapPage{