From c2f510eb79a81bbf187126bac196932523c974f8 Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Wed, 24 Feb 2021 18:28:14 -0500 Subject: [PATCH] Implement support for "lang" media type parameter --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index f836415..0e0e08a 100644 --- a/main.go +++ b/main.go @@ -131,7 +131,7 @@ var gemtextPage = template.Must(template. {{- end }} {{.Title}} -
+ {{ $ctx := . -}} {{- $isList := false -}} {{- range .Lines -}} @@ -364,6 +364,7 @@ type GemtextContext struct { Pre int Resp *gemini.Response Title string + Lang string URL *url.URL Root *url.URL } @@ -476,12 +477,15 @@ func proxyGemini(req gemini.Request, external bool, root *url.URL, } } + lang := params["lang"] + w.Header().Add("Content-Type", "text/html") ctx := &GemtextContext{ CSS: css, External: external, Resp: resp, Title: req.URL.Host + " " + req.URL.Path, + Lang: lang, URL: req.URL, Root: root, }