mirror of
https://github.com/1f349/site-hosting.git
synced 2025-01-20 22:26:37 +00:00
Support the old upload format for compatibility
This commit is contained in:
parent
d3c52c3d35
commit
e778f6c855
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user