1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-19 21:10:15 +02:00

Only allow POST to /api/render.

This commit is contained in:
Alec Thomas 2019-07-16 21:47:36 +10:00
parent ffa8a4f67f
commit aa71d61cc0

View File

@ -154,7 +154,7 @@ func main() {
router := mux.NewRouter()
router.Handle("/", http.HandlerFunc(index)).Methods("GET")
router.Handle("/api/render", http.HandlerFunc(renderHandler))
router.Handle("/api/render", http.HandlerFunc(renderHandler)).Methods("POST")
router.Handle("/static/{file:.*}", http.StripPrefix("/static/", http.FileServer(staticFiles.HTTPBox()))).Methods("GET")
options := []csrf.Option{}