Sha256: fadbf260012222868bd2568a56894e1b68a75c7f48171eda47a4ec878499123e

Contents?: true

Size: 825 Bytes

Versions: 53

Compression:

Stored size: 825 Bytes

Contents

module Rack
  module OAuth2
    module Debugger
      class RequestFilter
        # Callback called in HTTPClient (before sending a request)
        # request:: HTTP::Message
        def filter_request(request)
          started = "======= [Rack::OAuth2] HTTP REQUEST STARTED ======="
          log started, request.dump
        end

        # Callback called in HTTPClient (after received a response)
        # request::  HTTP::Message
        # response:: HTTP::Message
        def filter_response(request, response)
          finished = "======= [Rack::OAuth2] HTTP REQUEST FINISHED ======="
          log '-' * 50, response.dump, finished
        end

        private

        def log(*outputs)
          outputs.each do |output|
            OAuth2.logger.info output
          end
        end
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
rack-oauth2-1.21.3 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.21.2 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.21.1 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.21.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.20.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.19.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.18.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.17.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.16.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.15.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.14.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.13.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.13.0.beta lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.12.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.11.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.10.1 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.10.0 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.9.3 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.9.2 lib/rack/oauth2/debugger/request_filter.rb
rack-oauth2-1.9.1 lib/rack/oauth2/debugger/request_filter.rb