godemo
godemo copied to clipboard
csrf set in main package
dont you add this setting ?
`func main() { r := gin.Default()
csrf := nosurf.New(r)
csrf.SetFailureHandler(http.HandlerFunc(csrfFailHandler))
http.ListenAndServe(":8000", csrf)
}
func csrfFailHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "%s\n", nosurf.Reason(r)) } `
@ferluk Thank you for your suggestion.
I omitted nosurf handler by this commit. Because it rejected API request by SCRF protection. It's not expected(uncompleted) behavior.
If you fix this problem, please feel free to send pull request.