commit c486a346d475dd9090e5edc378c47897458d9bf5
parent 13fad702b41879527e7c9a28c5e2b82dedbbbc3d
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Tue, 12 Jul 2022 19:24:44 +0200
fix
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/config/taldir-example.conf b/config/taldir-example.conf
@@ -6,7 +6,7 @@ bind_to = "localhost:11000"
salt = "ChangeMe"
monthly_fee = KUDOS:1
default_doc_filetype = text/html
-default_doc_lang = en-US
+default_doc_lang = en
default_tos_path = terms/
default_pp_path = privacy/
supported_doc_filetypes = text/html application/pdf application/epub application/xml text/plain
diff --git a/pkg/rest/taldir.go b/pkg/rest/taldir.go
@@ -654,7 +654,7 @@ func (t *Taldir) termsResponse(w http.ResponseWriter, r *http.Request) {
for _, lang := range acceptLangs {
extensions, _ := mime.ExtensionsByType(fileType)
for _, ext := range extensions {
- docFile := fmt.Sprintf("%s/%s/0%s", termsLocation, lang.String, ext)
+ docFile := fmt.Sprintf("%s/%s/0%s", termsLocation, lang.String(), ext)
log.Printf("Trying %s\n", docFile)
fileBytes, err := ioutil.ReadFile(docFile)
if nil == err {
@@ -684,7 +684,7 @@ func (t *Taldir) termsResponse(w http.ResponseWriter, r *http.Request) {
}
func (t *Taldir) privacyResponse(w http.ResponseWriter, r *http.Request) {
- fileType := t.Cfg.Section("taldir").Key("default_doc_filetype").MustString("text/markdown")
+ fileType := t.Cfg.Section("taldir").Key("default_doc_filetype").MustString("text/html")
termsLocation := t.Cfg.Section("taldir").Key("default_pp_path").MustString("privacy/")
for _, typ := range r.Header["Accept"] {
for _, a := range strings.Split(t.Cfg.Section("taldir").Key("supported_doc_filetypes").String(), " ") {
@@ -699,7 +699,7 @@ func (t *Taldir) privacyResponse(w http.ResponseWriter, r *http.Request) {
for _, lang := range acceptLangs {
extensions, _ := mime.ExtensionsByType(fileType)
for _, ext := range extensions {
- docFile := fmt.Sprintf("%s/%s/0%s", termsLocation, lang.String, ext)
+ docFile := fmt.Sprintf("%s/%s/0%s", termsLocation, lang.String(), ext)
log.Printf("Trying %s\n", docFile)
fileBytes, err := ioutil.ReadFile(docFile)
if nil == err {