Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 210972

Summary: [Webapp] Infocenter sends bad redirect URLs in proxy environment
Product: [Eclipse Project] Platform Reporter: Dave Resch <dresch>
Component: User AssistanceAssignee: platform-ua-inbox <platform-ua-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: cgold, kowalskilee
Version: 3.3.1   
Target Milestone: ---   
Hardware: Sun   
OS: Solaris   
Whiteboard: stalebug

Description Dave Resch CLA 2007-11-26 14:57:43 EST
Build ID: 3.3.1.v20070726_33x

Steps To Reproduce:
1. Launch infocenter instance.
2. Use web server proxy mapping to point to infocenter's host:port
3. Access infocenter via mapped proxy URL, then open a generated "landing page" topic, or try to follow link with PLUGINS_ROOT shortcut in the path.

More information:
When infocenter receives a GET request with PLUGINS_ROOT shortcut in the path, it sometimes returns HTTP code 302, with a redirect URL that is missing a segment of the proxy URL.

Here's an example from an auto-generated "landing page" topic, with a <link> element pointing to the book.css file:

----------------------------------------------------------
http://infocenter.sybase.com/ws/content/PLUGINS_ROOT/PRODUCT_PLUGIN/book.css

GET /ws/content/PLUGINS_ROOT/PRODUCT_PLUGIN/book.css HTTP/1.1
Host: infocenter.sybase.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: cookiesEnabled=yes

HTTP/1.x 302 Moved Temporarily
Server: Sun-Java-System-Web-Server/7.0
Date: Wed, 21 Nov 2007 14:59:13 GMT
Location: http://infocenter.sybase.com/help/content/PRODUCT_PLUGIN/book.css
Content-Length: 0
Via: 1.1 https-PWSWEB1_1
Proxy-agent: Sun-Java-System-Web-Server/7.0
----------------------------------------------------------

The same thing happens with the auto-generated <link> element pointing to the breadcrumbs.css file: 

----------------------------------------------------------
http://infocenter.sybase.com/ws/content/PLUGINS_ROOT/org.eclipse.help.webapp/advanced/breadcrumbs.css

GET /ws/content/PLUGINS_ROOT/org.eclipse.help.webapp/advanced/breadcrumbs.css HTTP/1.1
Host: infocenter.sybase.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Accept: text/css,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://infocenter.sybase.com/ws/nav/1_4
Cookie: cookiesEnabled=yes

HTTP/1.x 302 Moved Temporarily
Server: Sun-Java-System-Web-Server/7.0
Date: Wed, 21 Nov 2007 15:02:08 GMT
Content-Length: 0
Location: http://infocenter.sybase.com/help/content/org.eclipse.help.webapp/advanced/breadcrumbs.css
Via: 1.1 https-PWSWEB1_1
Proxy-agent: Sun-Java-System-Web-Server/7.0
----------------------------------------------------------

Unfortunately, the redirect URL (missing /ws after the domain) is not valid, which results in the stylesheet not being found. This is an ugly presentation problem, but it is somewhat benign (inasmuch as it doesn't produce a user-visible error message).

Oddly, this problem does not occur with the auto-generated <link> element pointing to the breadcrumb.css file in a regular content topic:

----------------------------------------------------------
http://infocenter.sybase.com/ws/topic/com.sybase.stf.wssv.doc-SWS-2.0.0/projects/workspace/wssv/en/content/PLUGINS_ROOT/org.eclipse.help.webapp/advanced/breadcrumbs.css

GET /ws/topic/com.sybase.stf.wssv.doc-SWS-2.0.0/projects/workspace/wssv/en/content/PLUGINS_ROOT/org.eclipse.help.webapp/advanced/breadcrumbs.css HTTP/1.1
Host: infocenter.sybase.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Accept: text/css,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://infocenter.sybase.com/ws/topic/com.sybase.stf.wssv.doc-SWS-2.0.0/projects/workspace/wssv/en/source/c_administration.html
Cookie: cookiesEnabled=yes

HTTP/1.x 200 OK
Server: Sun-Java-System-Web-Server/7.0
Date: Wed, 21 Nov 2007 15:02:34 GMT
Content-Type: text/css
Cache-Control: max-age=10
Content-Encoding: gzip
Via: 1.1 https-PWSWEB1_1
Proxy-agent: Sun-Java-System-Web-Server/7.0
Transfer-Encoding: chunked
----------------------------------------------------------

BTW, The redirect also works fine for the auto-generated <script> element pointing to livehelp.js from a regular content topic.

The worst problem occurs when an <a> link in a regular content topic uses the PLUGINS_ROOT shortcut:

----------------------------------------------------------
http://infocenter.sybase.com/ws/topic/com.sybase.stf.wssv.doc-SWS-2.0.0/projects/workspace/wssv/en/source/PLUGINS_ROOT/com.sybase.stf.ws.doc-SWS-2.0.0/projects/workspace/ws/en/source/c_samples.html

GET /ws/topic/com.sybase.stf.wssv.doc-SWS-2.0.0/projects/workspace/wssv/en/source/PLUGINS_ROOT/com.sybase.stf.ws.doc-SWS-2.0.0/projects/workspace/ws/en/source/c_samples.html HTTP/1.1
Host: infocenter.sybase.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://infocenter.sybase.com/ws/topic/com.sybase.stf.wssv.doc-SWS-2.0.0/projects/workspace/wssv/en/source/c_administration.html
Cookie: cookiesEnabled=yes

HTTP/1.x 302 Moved Temporarily
Server: Sun-Java-System-Web-Server/7.0
Date: Wed, 21 Nov 2007 15:02:49 GMT
Location: http://infocenter.sybase.com/help/topic/com.sybase.stf.ws.doc-SWS-2.0.0/projects/workspace/ws/en/source/c_samples.html
Content-Length: 0
Via: 1.1 https-PWSWEB1_1
Proxy-agent: Sun-Java-System-Web-Server/7.0
----------------------------------------------------------

In this case, the bad redirect URL to the other topic gives the user "The topic that you have requested is not available....", which is not so benign.
Comment 1 Lee Anne Kowalski CLA 2009-01-16 11:20:09 EST
Hi Chris,

Would you please take a look at this bug and see if it's a similar fix as for Bug 254996?

I mean, maybe the code is a similar pattern for the hrefs in the auto-generated pages and breadcrumbs as the lines of code in PrintData.java.

Thanks in advance!
Lee Anne
Comment 2 Chris Goldthorpe CLA 2009-01-16 13:34:31 EST
This is not the same issue as Bug 254996, although it's possible that a similar approach would fix this one also. 

I just went to http://help.eclipse.org/ganymede/index.jsp, which is also behind a proxy server and ran firebug to see the net traffic. I am seeing a number of 302 responses from the server but in each case the client retries with the redirect URL and it succeeds. If this was a problem that affected all proxy servers I would expect the gannymede site to have the same problem. Dave, if you have time can you take a look at the gannymede site and see if you agree that the css files get read OK, albeit after a redirection?

I haven't worked with proxy servers in the past but I can kind of see what is going on. The help system has code which recognizes PLUGINS_ROOT in a URL and returns a redirect response with the actual URL, this response gets sent back to the web browser, which then uses the new URL to get the data. This seems a little inefficient as compared to just returning the data in a single trip but there may be good reasons for having done it this way. 

Can you verify that if you access this infocenter without going through the proxy that everthing works fine? If that is the case then the presence of the proxy server would be causing something to go wrong. Since the gannymede help server is behind a proxy and as far as I can tell works fine I have to wonder if something is happening in your setup. 

In the proxy environment the 302 response would pass through the proxy on the way back and get translated from a URL referencing the server address to a URL representing the proxy and if the proxy server is working correctly this should not cause any problems. Maybe you can take a look at how the proxy server is configured or better still trace the request response with the 302 error and see if you can see what it looks like before and after the proxy server process it.
Comment 3 Chris Goldthorpe CLA 2011-02-28 19:52:00 EST
Did you ever figure out what was going on on your server?
Comment 4 Lars Vogel CLA 2019-09-24 13:58:22 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 5 Eclipse Genie CLA 2022-02-14 03:23:44 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.