class Raven::Marten::Middleware

Overview

Sentry middleware for Marten.

In order to be used, this middleware should be added to the middleware Marten setting (ideally at the beginning of the middleware array):

Marten.configure do |config|
  config.middleware = [
    Raven::Marten::Middleware,
    Marten::Middleware::GZip,
    Marten::Middleware::XFrameOptions,
    Marten::Middleware::StrictTransportSecurity,
  ]
end

Defined in:

raven/integrations/marten/middleware.cr

Instance Method Summary

Instance Method Detail

def call(request : ::Marten::HTTP::Request, get_response : Proc(::Marten::HTTP::Response)) : ::Marten::HTTP::Response #
Description copied from class Marten::Middleware

Calls the middleware for a given HTTP request and returns a HTTP response.

This method must be implemented by subclasses: it takes a request argument (the current HTTP request) and a get_response proc that allows to get the final response. This proc might actually call the next middleware in the chain of configured middlewares, or the final matched handler. That way, the current middleware have the ability to intercept any incoming request and the associated response, and to modify them if applicable.


[View source]