This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This method is heavily adapted from the Rails method of determining the subdomain. | |
require 'rubygems' | |
require 'sinatra' | |
require 'rack/request' | |
# We re-open the request class to add the subdomains method | |
module Rack | |
class Request | |
def subdomains(tld_len=1) # we set tld_len to 1, use 2 for co.uk or similar |
NewerOlder