Sha256: aa9187e961ed56a5486f6b8ad54ac6ee13e9d2a316cd763515ce0e5fc353e4dd

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

module HerokuHeaders
  # Rack compatible middleware to add heroku release info to headers
  class Middleware
    def initialize(app)
      @app = app
      @heroku_header = {
        "Heroku-Release" => "#{ENV['HEROKU_RELEASE_VERSION']}, #{ENV['HEROKU_SLUG_COMMIT']}, #{ENV["HEROKU_RELEASE_CREATED_AT"]}",
      }.freeze
    end

    def call(env)
      status, headers, response = @app.call(env)

      headers = headers.merge(@heroku_header)

      [status, headers, response]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heroku-headers-0.9.2 lib/heroku-headers/middleware.rb