Hey All,
Could someone explain why relative_url_root is hardcoded to only work
with apache:
request.rb (154:158):
# Returns the path minus the web server relative installation directory.
# This method returns nil unless the web server is apache.
def relative_url_root
@@relative_url_root ||= server_software == ''apache'' ?
@env["SCRIPT_NAME"].to_s.sub(/\/dispatch\.(fcgi|rb|cgi)$/,
'''') : ''''
end
I''d like to use it with lighttpd as well. I''ll submit a patch
but
just wanted to check the thinking on why it was restricted to apache
in the first place.
Also, how would you feel about a patch to let you specify the relative
url as an env variable (i.e. RAILS_RELATIVE_URL_ROOT)? Seems like a
good candidate for something to be set by the server config file.
Thanks!
- Isaac
On Mar 14, 2006, at 2:06 PM, Isaac Reuben wrote:> Could someone explain why relative_url_root is hardcoded to only work > with apache:Because lighttpd doesn''t set SCRIPT_NAME in the way we require. If you figure out a way to implement the auto-detection, create a ticket and assign me as owner. For the time being, it''s not especially tricky to set the root in environment. (Although we should add a configuration option for it...) _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core