Add CSRF protection for cookie-authenticated requests
This commit is contained in:
@@ -168,7 +168,7 @@ func (h *Handler) AdminDelete(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
c.Redirect(301, "/admin")
|
||||
c.Redirect(303, "/admin")
|
||||
}
|
||||
|
||||
func (h *Handler) AdminForceDelete(c *gin.Context) {
|
||||
@@ -185,7 +185,7 @@ func (h *Handler) AdminForceDelete(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
c.Redirect(301, "/admin")
|
||||
c.Redirect(303, "/admin")
|
||||
}
|
||||
|
||||
func (h *Handler) Import(c *gin.Context) {
|
||||
|
||||
@@ -24,8 +24,8 @@ func RegisterRoutes(r *gin.RouterGroup, h *Handler) {
|
||||
|
||||
adminRoutes.GET("/download/:id", h.AdminGet)
|
||||
|
||||
adminRoutes.GET("/delete/:id", h.AdminDelete)
|
||||
adminRoutes.GET("/delete/fr/:id", h.AdminForceDelete)
|
||||
adminRoutes.POST("/delete/:id", h.AdminDelete)
|
||||
adminRoutes.POST("/delete/fr/:id", h.AdminForceDelete)
|
||||
|
||||
adminRoutes.POST("/import", h.Import)
|
||||
adminRoutes.GET("/export", h.Export)
|
||||
|
||||
Reference in New Issue
Block a user