Skip to content

Commit

Permalink
apply jens review
Browse files Browse the repository at this point in the history
  • Loading branch information
AlaaAttya committed Jun 27, 2019
1 parent 3a27d20 commit f9c0e97
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fdhttp/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,16 @@ func (r *Router) OPTIONS(path string, fn EndpointFunc) *Endpoint {
return r.Handler("OPTIONS", path, fn)
}

// HEAD register a fdhttp.EndpointFunc to handle HEAD method
func (r *Router) HEAD(path string, fn EndpointFunc) *Endpoint {
return r.Handler("HEAD", path, fn)
}

// PATCH register a fdhttp.EndpointFunc to handle PATCH method
func (r *Router) PATCH(path string, fn EndpointFunc) *Endpoint {
return r.Handler("PATCH", path, fn)
}

// ServeHTTP makes this struct a valid implementation of http.Handler
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if r.rootHandler == nil {
Expand Down

0 comments on commit f9c0e97

Please sign in to comment.