Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (17 sloc) 0.408 kB
class WwwMiddleware
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
if request.host =~ /heroku|programming-quotes/
[301, {"Location" => "http://hackersays.com"}, self]
elsif request.host[0..3] == "www."
[301, {"Location" => request.url.sub("//www.", "//")}, self]
else
@app.call(env)
end
end
def each(&block)
end
end
Jump to Line
Something went wrong with that request. Please try again.