Skip to content

Commit

Permalink
Support the old upload format for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmelon54 committed Jan 8, 2025
1 parent d3c52c3 commit e778f6c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e778f6c

Please sign in to comment.