Skip to content

Commit

Permalink
Merge pull request #1 from fzn0x/patch-1
Browse files Browse the repository at this point in the history
feat: add OPTION to allow preflight requests (CORS)
  • Loading branch information
zakirkun authored Sep 22, 2022
2 parents 3eb8aa1 + 72e6bc9 commit 4bf16da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions oppai/oppai.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func (e *RouterGroup) DELETE(pattern string, handler HandlerFunc) {
e.AddRoutes("DELETE", pattern, handler)
}

func (e *Engine) OPTION(pattern string, handler HandlerFunc) {
e.router.AddRoutes("OPTION", pattern, handler)
}

func (e *Engine) Run(addr string) (err error) {
return http.ListenAndServe(addr, e)
}
Expand Down

0 comments on commit 4bf16da

Please sign in to comment.