Skip to content

Commit 610d67f

Browse files
kolaentevishr
authored andcommitted
Added support for the REPORT method (#1332)
1 parent 530f768 commit 610d67f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

echo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ const (
170170
charsetUTF8 = "charset=UTF-8"
171171
// PROPFIND Method can be used on collection and property resources.
172172
PROPFIND = "PROPFIND"
173+
// REPORT Method can be used to get information about a resource, see rfc 3253
174+
REPORT = "REPORT"
173175
)
174176

175177
// Headers
@@ -251,6 +253,7 @@ var (
251253
PROPFIND,
252254
http.MethodPut,
253255
http.MethodTrace,
256+
REPORT,
254257
}
255258
)
256259

router.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type (
3333
propfind HandlerFunc
3434
put HandlerFunc
3535
trace HandlerFunc
36+
report HandlerFunc
3637
}
3738
)
3839

@@ -247,6 +248,8 @@ func (n *node) addHandler(method string, h HandlerFunc) {
247248
n.methodHandler.put = h
248249
case http.MethodTrace:
249250
n.methodHandler.trace = h
251+
case REPORT:
252+
n.methodHandler.report = h
250253
}
251254
}
252255

@@ -272,6 +275,8 @@ func (n *node) findHandler(method string) HandlerFunc {
272275
return n.methodHandler.put
273276
case http.MethodTrace:
274277
return n.methodHandler.trace
278+
case REPORT:
279+
return n.methodHandler.report
275280
default:
276281
return nil
277282
}

0 commit comments

Comments
 (0)