Skip to content

Instantly share code, notes, and snippets.

View thiagodiniz's full-sized avatar
🏠
Working from home

Thiago Diniz thiagodiniz

🏠
Working from home
View GitHub Profile
@trevorturk
trevorturk / no_www.rb
Created November 3, 2009 05:03
no-www rack middleware
class NoWWW
STARTS_WITH_WWW = /^www\./i
def initialize(app)
@app = app
end
def call(env)
if env['HTTP_HOST'] =~ STARTS_WITH_WWW