diff --git a/app/main.go b/app/main.go index b1e1cd99..b7205631 100644 --- a/app/main.go +++ b/app/main.go @@ -123,7 +123,7 @@ func main() { DataService: dataService, Exporter: &exporter, WebRoot: opts.WebRoot, - ImageProxy: proxy.Image{Enabled: opts.ImageProxy, RoutePath: "/img"}, + ImageProxy: proxy.Image{Enabled: opts.ImageProxy, RoutePath: "/api/v1/img"}, Authenticator: auth.Authenticator{ Admins: opts.Admins, SessionStore: sessionStore, diff --git a/app/rest/api/rest.go b/app/rest/api/rest.go index fac27feb..8930d768 100644 --- a/app/rest/api/rest.go +++ b/app/rest/api/rest.go @@ -123,7 +123,7 @@ func (s *Rest) routes() chi.Router { ropen.Get("/config", s.configCtrl) ropen.Post("/preview", s.previewCommentCtrl) ropen.Mount("/rss", s.rssRoutes()) - ropen.Mount("/proxy", s.ImageProxy.Routes()) + ropen.Mount("/img", s.ImageProxy.Routes()) }) // protected routes, require auth diff --git a/app/rest/proxy/image.go b/app/rest/proxy/image.go index d65530b9..ea10ea3b 100644 --- a/app/rest/proxy/image.go +++ b/app/rest/proxy/image.go @@ -41,7 +41,7 @@ func (p Image) Routes() chi.Router { if !p.Enabled { return router } - router.Get(p.RoutePath, func(w http.ResponseWriter, r *http.Request) { + router.Get("/", func(w http.ResponseWriter, r *http.Request) { src, err := base64.URLEncoding.DecodeString(r.URL.Query().Get("src")) if err != nil { rest.SendErrorJSON(w, r, http.StatusBadRequest, err, "can't decode image url")