Per handler middleware has to extend ILocalMiddleware It is called only if enabled
| 19 | // Per handler middleware has to extend ILocalMiddleware |
| 20 | // It is called only if enabled |
| 21 | struct SecretContentGuard : crow::ILocalMiddleware |
| 22 | { |
| 23 | struct context |
| 24 | {}; |
| 25 | |
| 26 | void before_handle(crow::request& /*req*/, crow::response& res, context& /*ctx*/) |
| 27 | { |
| 28 | // A request can be aborted prematurely |
| 29 | res.write("SECRET!"); |
| 30 | res.code = 403; |
| 31 | res.end(); |
| 32 | } |
| 33 | |
| 34 | void after_handle(crow::request& /*req*/, crow::response& /*res*/, context& /*ctx*/) |
| 35 | {} |
| 36 | }; |
| 37 | |
| 38 | struct RequestAppend : crow::ILocalMiddleware |
| 39 | { |
nothing calls this directly
no outgoing calls
no test coverage detected