1
0
Fork 0

For whatever reason Go doesn't fill r.URL.Scheme. So let's get it directly from Scheme header that is being set in nginx's proxy_set_header Scheme $scheme.

This commit is contained in:
Alexander Andreev 2023-09-23 19:57:53 +04:00
parent 98e948f982
commit 6895c1c0a6
Signed by: Arav
GPG Key ID: D22A817D95815393
1 changed files with 7 additions and 1 deletions

View File

@ -168,8 +168,14 @@ func (h *Handlers) RSS(w http.ResponseWriter, r *http.Request) {
if err != nil {
return
}
var scheme string
if r.Header.Get("Scheme") != "" {
scheme = r.Header.Get("Scheme")
} else {
scheme = "http"
}
web.RSS(r.URL.Scheme+"://"+r.Host, "Arav", posts, r, w)
web.RSS(scheme+"://"+r.Host, "Arav", posts, r, w)
}
func FaviconIco(w http.ResponseWriter, r *http.Request) {