1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Added support for the REPORT method (#1332)

This commit is contained in:
kolaente 2019-06-09 18:11:18 +02:00 committed by Vishal Rana
parent 530f768a47
commit 610d67f17f
2 changed files with 8 additions and 0 deletions

View File

@ -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
@ -251,6 +253,7 @@ var (
PROPFIND,
http.MethodPut,
http.MethodTrace,
REPORT,
}
)

View File

@ -33,6 +33,7 @@ type (
propfind HandlerFunc
put HandlerFunc
trace HandlerFunc
report HandlerFunc
}
)
@ -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
}
}
@ -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
}