const mixinafSleepSafe::Guard
afSleepSafe::Guard
Guard against malicious attacks by inspecting HTTP requests.
Once implemented, contribute it to SleepSafeMiddleware
:
@Contribute { serviceType=SleepSafeMiddleware# } Void contributeSleepSafeMiddleware(Configuration config) { config[MyGuard#] = config.build(MyGuard#) }
- guard
abstract Obj? guard(HttpRequest req, HttpResponse res)
Called at the start of HTTP request. Return an error message / object to reject the request.
- protectsAgainst
abstract Str protectsAgainst()
Return what this Guard protects against. Used in startup logging.