move redirectors, renderRelay and renderProfile out of render.

This commit is contained in:
fiatjaf
2023-10-21 14:09:37 -03:00
parent f70b13afe7
commit ebeb9820d8
8 changed files with 123 additions and 149 deletions

View File

@@ -11,8 +11,14 @@ import (
)
func renderRelayPage(w http.ResponseWriter, r *http.Request) {
code := r.URL.Path[1:]
hostname := code[2:]
hostname := r.URL.Path[3:]
if strings.HasPrefix(hostname, "wss:/") || strings.HasPrefix(hostname, "ws:/") {
hostname = trimProtocol(hostname)
http.Redirect(w, r, "/r/"+hostname, http.StatusFound)
return
}
isSitemap := false
numResults := 1000