Skip to content

Commit

Permalink
added OPTIONS mehod
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Svinartchouk authored and bmizerany committed Jun 13, 2012
1 parent 7ea1764 commit 93b1a48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mux.go
Expand Up @@ -157,6 +157,11 @@ func (p *PatternServeMux) Del(pat string, h http.Handler) {
p.Add("DELETE", pat, h) p.Add("DELETE", pat, h)
} }


// Options will register a pattern with a handler for OPTIONS requests.
func (p *PatternServeMux) Options(pat string, h http.Handler) {
p.Add("OPTIONS", pat, h)
}

// Add will register a pattern with a handler for meth requests. // Add will register a pattern with a handler for meth requests.
func (p *PatternServeMux) Add(meth, pat string, h http.Handler) { func (p *PatternServeMux) Add(meth, pat string, h http.Handler) {
p.handlers[meth] = append(p.handlers[meth], &patHandler{pat, h}) p.handlers[meth] = append(p.handlers[meth], &patHandler{pat, h})
Expand Down

0 comments on commit 93b1a48

Please sign in to comment.