HTTP_HOST variable not available in rack using jruby-rack

Hi,

Jruby 1.4, Rails 2.3.8, Java 1.6, Solaris, Tomcat 5.5

Seeing an issue where we are tryign to force the cookie domain in Rack,
however the env[“HTTP_HOST”] is not being passed for some reason. env[
“HTTP_HOST”] shows up as a blank variable in the rack middleware.

Also to note, works find under script/server but not under tomcat. Is
there
something about jruby-rack that we need to do to enable these
environment
variables to come through ?
Thanks AD

Is $HTTP_HOST even a standard CGI variable? Could $SERVER_NAME be a
standard alternative?

Server Name: The web server’s hostname or IP address.
Very similarly to SCRIPT_NAME this value can be used to create more
portable scripts in case they need to assemble URLs on the local
machine. In scripts that are made publically accessible on a system
with many virtual hosts, this can provide the ability to have
different behaviours depending on the virtual server that’s calling
the script.

On Thu, 2010-07-22 at 10:36 -0400, AD wrote:

Also to note, works find under script/server but not under tomcat. Is
there something about jruby-rack that we need to do to enable these
environment variables to come through ?

Thanks AD


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I could be talking rubbish about HTTP_HOST, but it does look like
jruby-rack only sets the SERVER_NAME variable, and not the HTTP_HOST one
from the Servlet request (maybe because there is no request.getHTTPHost
method, only request.getServerName).

On Fri, 2010-07-23 at 11:41 +0100, Nick G. wrote:

middleware.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Thu, Jul 22, 2010 at 9:36 AM, AD [email protected] wrote:

Hi,
Jruby 1.4, Rails 2.3.8, Java 1.6, Solaris, Tomcat 5.5
Seeing an issue where we are tryign to force the cookie domain in Rack,
however the env[“HTTP_HOST”] is not being passed for some reason.
env[“HTTP_HOST”] shows up as a blank variable in the rack middleware.
Also to note, works find under script/server but not under tomcat. Is there
something about jruby-rack that we need to do to enable these environment
variables to come through ?

HTTP_HOST should come from the “Host:” HTTP Header. Perhaps for some
reason Tomcat is not passing it through? JRuby-Rack should be
translating all headers into “HTTP_” values in the Rack environment;
see 1 for the source.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs