From e778f6c85538b1b206457274b260058b0a41db40 Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Wed, 8 Jan 2025 20:07:10 +0000 Subject: [PATCH] Support the old upload format for compatibility --- api/api.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/api.go b/api/api.go index e0e7f38..543048b 100644 --- a/api/api.go +++ b/api/api.go @@ -26,6 +26,13 @@ func New(upload *upload.Handler, keyStore *mjwt.KeyStore, db apiDB) *httprouter. // Site upload endpoint router.POST("/u/:site/:branch", upload.Handle) + router.POST("/u", func(rw http.ResponseWriter, req *http.Request, _ httprouter.Params) { + q := req.URL.Query() + upload.Handle(rw, req, httprouter.Params{ + {"site", q.Get("site")}, + {"branch", q.Get("branch")}, + }) + }) // Site creation endpoint router.PUT("/sites/:host", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) {