Skip to content

Commit

Permalink
better domain "parsing" (ie. handles localhost case)
Browse files Browse the repository at this point in the history
  • Loading branch information
S. Brent Faulkner committed Jul 5, 2010
1 parent 65d5060 commit f52770b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinatra-helpers/haml/links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Helpers
module Haml
module Links
def domain(tld_length = 1)
request.host.split('.')[-(tld_length+1)..-1].join('.')
request.host.split('.').last(1 + tld_length).join('.')
end

def subdomain(name, tld_length = 1)
Expand Down

0 comments on commit f52770b

Please sign in to comment.