Class: Redisse::RedirectEndpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/redisse/redirect_endpoint.rb

Overview

Rack app that redirects to the Redisse server via X-Accel-Redirect.

Instance Method Summary (collapse)

Constructor Details

- (RedirectEndpoint) initialize(redisse)

Returns a new instance of RedirectEndpoint



8
9
10
11
# File 'lib/redisse/redirect_endpoint.rb', line 8

def initialize(redisse)
  @redisse = redisse
  self.base_url = redisse.nginx_internal_url
end

Instance Method Details

- (Object) call(env)



13
14
15
16
17
# File 'lib/redisse/redirect_endpoint.rb', line 13

def call(env)
  response = Rack::Response.new
  response['X-Accel-Redirect'] = redirect_url(env)
  response
end