mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Request#subdomain returns a string version of Request#subdomains
This commit is contained in:
parent
7317d9ef4c
commit
fef7a77386
1 changed files with 4 additions and 0 deletions
|
@ -81,6 +81,10 @@ module ActionDispatch
|
||||||
parts[0..-(tld_length+2)]
|
parts[0..-(tld_length+2)]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def subdomain(tld_length = 1)
|
||||||
|
subdomains(tld_length).join('.')
|
||||||
|
end
|
||||||
|
|
||||||
# Returns the query string, accounting for server idiosyncrasies.
|
# Returns the query string, accounting for server idiosyncrasies.
|
||||||
def query_string
|
def query_string
|
||||||
@env['QUERY_STRING'].present? ? @env['QUERY_STRING'] : (@env['REQUEST_URI'].to_s.split('?', 2)[1] || '')
|
@env['QUERY_STRING'].present? ? @env['QUERY_STRING'] : (@env['REQUEST_URI'].to_s.split('?', 2)[1] || '')
|
||||||
|
|
Loading…
Reference in a new issue