Probably you are getting different headers and/or Apache is not passing some of them through. Log out the request headers and see what is there. Also compare to the code in ERXRequest.isRequestSecure
Chuck On 2016-04-22, 9:03 AM, "[email protected] on behalf of Gino Pacitti" <[email protected] on behalf of [email protected]> wrote: >Hi List >I have been using an implementation of this SecureComponent (see below) in a >few apps but since I have now moved. The new set is: > >Centos 6.7 Container >Apache 2.2.15 - SSL enabled etc. >mod_webobjects.so adaptor 5.5 Adaptor from - >http://wocommunity.org/documents/tools/mod_WebObjects/Apache2.2/centos/5.5/x86_64/ > > >It now seems to be doing something strange and will not return the secure page. > >Firstly port returns 0 and woserverport returns null. And then in my log it >shows the request coming back quite a few times resulting in the page >complaining about too many redirects and showing blank. > >Any ideas? > > > >public class SecureComponent extends WOComponent { > protected boolean sslRequired; > > public boolean getSslRequired() { > return sslRequired; > } > public void setSslRequired(boolean newSslRequired) { > sslRequired = newSslRequired; > } > public void appendToResponse(WOResponse res, WOContext con) { > String protocol = null; > boolean switchRequired = false; > > super.appendToResponse(res, con); > WORequest req = con.request(); > String port = req.headerForKey("SERVER_PORT"); > String woserverport = req.headerForKey("x-webobjects-server-port"); > > if (sslRequired) { > if ( port != null && !port.equals("443") ) { > switchRequired = true; > } else if ( woserverport != null && !woserverport.equals("443") >) { > switchRequired = true; > } else { > // unable to determine if switch is needed. > switchRequired = false; > } > } else { > if ( port != null && port.equals("443") ) { > switchRequired = true; > } else if ( woserverport != null && woserverport.equals("443") ) >{ > switchRequired = true; > } else { > // unable to determine if switch is needed. > switchRequired = false; > } > } > > if (switchRequired) { > if ( sslRequired) { > protocol = "https://" ; > } else { > protocol = "http://" ; > } > String url = >protocol+req.headerForKey("host")+con.componentActionURL(); > res.setHeader(url, "location"); > res.setHeader("text/html", "content-type"); > res.setHeader("0", "content-length"); > res.setStatus(302); > } > } >} > > > _______________________________________________ >Do not post admin requests to the list. They will be ignored. >Webobjects-dev mailing list ([email protected]) >Help/Unsubscribe/Update your Subscription: >https://lists.apple.com/mailman/options/webobjects-dev/chill%40gevityinc.com > >This email sent to [email protected] _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
