mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-27 21:49:13 +02:00
Only allow POST to /api/render.
This commit is contained in:
parent
ffa8a4f67f
commit
aa71d61cc0
@ -154,7 +154,7 @@ func main() {
|
|||||||
|
|
||||||
router := mux.NewRouter()
|
router := mux.NewRouter()
|
||||||
router.Handle("/", http.HandlerFunc(index)).Methods("GET")
|
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")
|
router.Handle("/static/{file:.*}", http.StripPrefix("/static/", http.FileServer(staticFiles.HTTPBox()))).Methods("GET")
|
||||||
|
|
||||||
options := []csrf.Option{}
|
options := []csrf.Option{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user