Sha256: 49a390f834e5dc4e069519684e08761456d6c8550ea6ccfd1436f05d5e30bb14

Contents?: true

Size: 367 Bytes

Versions: 14

Compression:

Stored size: 367 Bytes

Contents

require 'uuid'
require 'sitehub/constants'
class SiteHub
  module Middleware
    class TransactionId
      include Constants

      def initialize(app)
        @app = app
      end

      def call(env)
        request = env[REQUEST]
        request.headers[HttpHeaderKeys::TRANSACTION_ID] ||= UUID.generate(:compact)
        @app.call env
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sitehub-0.5.0.alpha12 lib/sitehub/middleware/transaction_id.rb
sitehub-0.4.10 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha11 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha10 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha8 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha7 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha6 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha5 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha4 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha3 lib/sitehub/middleware/transaction_id.rb
sitehub-0.5.0.alpha2 lib/sitehub/middleware/transaction_id.rb
sitehub-0.4.9 lib/sitehub/middleware/transaction_id.rb
sitehub-0.4.8 lib/sitehub/middleware/transaction_id.rb
sitehub-0.4.7 lib/sitehub/middleware/transaction_id.rb