gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taldir] branch master updated: fix


From: gnunet
Subject: [taler-taldir] branch master updated: fix
Date: Tue, 12 Jul 2022 19:24:46 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository taldir.

The following commit(s) were added to refs/heads/master by this push:
     new c486a34  fix
c486a34 is described below

commit c486a346d475dd9090e5edc378c47897458d9bf5
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Jul 12 19:24:44 2022 +0200

    fix
---
 config/taldir-example.conf | 2 +-
 pkg/rest/taldir.go         | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/config/taldir-example.conf b/config/taldir-example.conf
index 6feba2a..50be797 100644
--- 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
index 4de7c23..77f49f8 100644
--- 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 {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]