tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russ White" <>
Subject RE: request.getScheme() not returning correct scheme
Date Thu, 10 Aug 2000 18:04:22 GMT
Yes you are right, and I am sorry I did not mention that the fix applies to

Russ White
Java, it's not just for breakfast anymore...

-----Original Message-----
From: []On Behalf Of Rachel
Sent: Thursday, August 10, 2000 12:19 PM
Subject: Re: request.getScheme() not returning correct scheme

Russ White wrote:
> I worked around the problem by adding this line:


Yes, I found it in archives, thanks. :-)

However, of course, I presume that's a fix to 3.2 as it doesn't apply to 3.1
(no for a start, and other stuff).

So anyway, I tried adapting it for 3.1, but the change in HttpRequestAdapter
didn't work, nor did putting in a similar change in
RequestImpl.setServerPort(int). Presumably something is re-setting the
scheme member variable outside of those.

What *did* get it in the end was, in org.apache.tomcat.core.RequestImpl to
change the getScheme() method ie:

    public String getScheme() {
        return (getServerPort()==443?"https":scheme);
        // wriggle out of that you bastard.

Hideous I know - it means we're not returning a true reflection of our
internal state. But it does work. :-} And it's only until a release version
fixes the bug for good 'n' proper.

... hoping the commercial servlet engine(s) we eventually deploy on doesn't
have this bug...

View raw message