makeHandlerWithOptions creates an http.Handler that will run a handler with the given method handlerOptions
(server *ServerContext, privs handlerPrivs, accessPermissions []Permission, responsePermissions []Permission, method handlerMethod, options handlerOptions)
| 125 | |
| 126 | // makeHandlerWithOptions creates an http.Handler that will run a handler with the given method handlerOptions |
| 127 | func makeHandlerWithOptions(server *ServerContext, privs handlerPrivs, accessPermissions []Permission, responsePermissions []Permission, method handlerMethod, options handlerOptions) http.Handler { |
| 128 | return http.HandlerFunc(func(r http.ResponseWriter, rq *http.Request) { |
| 129 | serverType := getCtxServerType(rq.Context()) |
| 130 | h := newHandler(server, privs, serverType, r, rq, options) |
| 131 | err := h.invoke(method, accessPermissions, responsePermissions) |
| 132 | h.writeError(err) |
| 133 | if !options.skipLogDuration { |
| 134 | h.logDuration(true) |
| 135 | } |
| 136 | h.reportDbStats() |
| 137 | }) |
| 138 | } |
| 139 | |
| 140 | // makeHandler creates an http.Handler that will run a handler with the given method |
| 141 | func makeHandler(server *ServerContext, privs handlerPrivs, accessPermissions []Permission, responsePermissions []Permission, method handlerMethod) http.Handler { |
no test coverage detected