MCPcopy Create free account
hub / github.com/CrowCpp/Crow / SecretContentGuard

Class SecretContentGuard

examples/example_middleware.cpp:21–36  ·  view source on GitHub ↗

Per handler middleware has to extend ILocalMiddleware It is called only if enabled

Source from the content-addressed store, hash-verified

19// Per handler middleware has to extend ILocalMiddleware
20// It is called only if enabled
21struct 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
38struct RequestAppend : crow::ILocalMiddleware
39{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected