Skip to content

Commit

Permalink
Added support for the REPORT method (#1332)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolaente authored and vishr committed Jun 9, 2019
1 parent 530f768 commit 610d67f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ const (
charsetUTF8 = "charset=UTF-8"
// PROPFIND Method can be used on collection and property resources.
PROPFIND = "PROPFIND"
// REPORT Method can be used to get information about a resource, see rfc 3253
REPORT = "REPORT"
)

// Headers
Expand Down Expand Up @@ -251,6 +253,7 @@ var (
PROPFIND,
http.MethodPut,
http.MethodTrace,
REPORT,
}
)

Expand Down
5 changes: 5 additions & 0 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type (
propfind HandlerFunc
put HandlerFunc
trace HandlerFunc
report HandlerFunc
}
)

Expand Down Expand Up @@ -247,6 +248,8 @@ func (n *node) addHandler(method string, h HandlerFunc) {
n.methodHandler.put = h
case http.MethodTrace:
n.methodHandler.trace = h
case REPORT:
n.methodHandler.report = h
}
}

Expand All @@ -272,6 +275,8 @@ func (n *node) findHandler(method string) HandlerFunc {
return n.methodHandler.put
case http.MethodTrace:
return n.methodHandler.trace
case REPORT:
return n.methodHandler.report
default:
return nil
}
Expand Down

0 comments on commit 610d67f

Please sign in to comment.