all repos — flounder @ 6c814bb3f1ed4320bc0a072caeaaac83fd653673

A small site builder for the Gemini protocol

Improve proxy
alex wennerberg alex@alexwennerberg.com
Wed, 10 Feb 2021 20:47:53 -0800
commit

6c814bb3f1ed4320bc0a072caeaaac83fd653673

parent

8d930b0741c22b9c3453beae9d7892b1191be4e2

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M proxy.goproxy.go

@@ -109,7 +109,9 @@ resp.Status, resp.Meta, err)))

return } - if m != "text/gemini" { + _, raw := r.URL.Query()["raw"] + acceptsGemini := strings.Contains(r.Header.Get("Accept"), "text/gemini") + if m != "text/gemini" || raw || acceptsGemini { w.Header().Add("Content-Type", resp.Meta) io.Copy(w, resp.Body) return

@@ -128,7 +130,7 @@ PageTitle string

GeminiURI *url.URL URI *url.URL Config Config - }{template.HTML(htmlDoc.Content), "", r.URL.String(), req.URL, r.URL, c} + }{template.HTML(htmlDoc.Content), "", htmlDoc.Title, req.URL, r.URL, c} err = t.ExecuteTemplate(w, "user_page.html", data) if err != nil {