summaryrefslogtreecommitdiff
path: root/src/gmi/gmi.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/gmi/gmi.go')
-rw-r--r--src/gmi/gmi.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gmi/gmi.go b/src/gmi/gmi.go
index 467ab5a..e37ca74 100644
--- a/src/gmi/gmi.go
+++ b/src/gmi/gmi.go
@@ -14,14 +14,14 @@ import (
"path/filepath"
"strings"
- "git.sr.ht/~adnano/go-gemini"
- "git.sr.ht/~adnano/go-gemini/certificate"
"dev.mediocregopher.com/mediocre-blog.git/src/cache"
"dev.mediocregopher.com/mediocre-blog.git/src/cfg"
"dev.mediocregopher.com/mediocre-blog.git/src/post"
"dev.mediocregopher.com/mediocre-blog.git/src/post/asset"
"dev.mediocregopher.com/mediocre-go-lib.git/mctx"
"dev.mediocregopher.com/mediocre-go-lib.git/mlog"
+ "git.sr.ht/~adnano/go-gemini"
+ "git.sr.ht/~adnano/go-gemini/certificate"
)
// Params are used to instantiate a new API instance. All fields are required
@@ -37,7 +37,8 @@ type Params struct {
ListenAddr string
CertificatesPath string
- HTTPPublicURL *url.URL
+ HTTPPublicURL *url.URL
+ HTTPGeminiGatewayURL *url.URL
}
// SetupCfg implement the cfg.Cfger interface.
@@ -193,12 +194,7 @@ func postsMiddleware(tplHandler gemini.Handler) gemini.Handler {
return
}
- query := r.URL.Query()
- query.Set("id", id)
- r.URL.RawQuery = query.Encode()
-
- r.URL.Path = "/posts/post.gmi"
-
+ ctx = withTplPath(ctx, "/posts/post.gmi")
tplHandler.ServeGemini(ctx, rw, r)
})
}