(method string, r *routeMethod)
| 169 | } |
| 170 | |
| 171 | func (m *routeMethods) set(method string, r *routeMethod) { |
| 172 | switch method { |
| 173 | case http.MethodConnect: |
| 174 | m.connect = r |
| 175 | case http.MethodDelete: |
| 176 | m.delete = r |
| 177 | case http.MethodGet: |
| 178 | m.get = r |
| 179 | case http.MethodHead: |
| 180 | m.head = r |
| 181 | case http.MethodOptions: |
| 182 | m.options = r |
| 183 | case http.MethodPatch: |
| 184 | m.patch = r |
| 185 | case http.MethodPost: |
| 186 | m.post = r |
| 187 | case PROPFIND: |
| 188 | m.propfind = r |
| 189 | case http.MethodPut: |
| 190 | m.put = r |
| 191 | case http.MethodTrace: |
| 192 | m.trace = r |
| 193 | case REPORT: |
| 194 | m.report = r |
| 195 | case RouteAny: |
| 196 | m.any = r |
| 197 | case RouteNotFound: |
| 198 | m.notFoundHandler = r |
| 199 | return // RouteNotFound/404 is not considered as a handler so no further logic needs to be executed |
| 200 | default: |
| 201 | if m.anyOther == nil { |
| 202 | m.anyOther = make(map[string]*routeMethod) |
| 203 | } |
| 204 | if r.handler == nil { |
| 205 | delete(m.anyOther, method) |
| 206 | } else { |
| 207 | m.anyOther[method] = r |
| 208 | } |
| 209 | } |
| 210 | m.updateAllowHeader() |
| 211 | } |
| 212 | |
| 213 | func (m *routeMethods) find(method string, fallbackToAny bool) *routeMethod { |
| 214 | var r *routeMethod |
no test coverage detected