Class: Gitlab::Middleware::Go

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/middleware/go.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Go

Returns a new instance of Go


6
7
8
# File 'lib/gitlab/middleware/go.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object


10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/middleware/go.rb', line 10

def call(env)
  request = Rack::Request.new(env)

  if go_request?(request)
    render_go_doc(request)
  else
    @app.call(env)
  end
end