Bug 187610 - [Help] On Linux TOC links to external sites fail
Summary: [Help] On Linux TOC links to external sites fail
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P2 major (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Adam Archer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-05-17 13:28 EDT by Chris Goldthorpe CLA
Modified: 2007-06-11 10:04 EDT (History)
1 user (show)

See Also:
curtispd: review+


Attachments
Patch (1.18 KB, patch)
2007-05-23 19:28 EDT, Adam Archer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Goldthorpe CLA 2007-05-17 13:28:12 EDT
I20070517-0010

Help/Help Contents
Expand Platform Plug-In Developer Guide/Programmer's Guide/Welcome to Eclipse
Click on the link Go to Eclipse.org

Expected result: eclipse.org web page opens (I can open this page from my browser)

Actual result:

HTTP ERROR: 404

/www.eclipse.org Not Found

RequestURI=/www.eclipse.org

Powered by Jetty://

I also cannot open this page from the help view, the only difference is that I do not see an error message, just a blank screen.

Note that this is just a link to "http://www.eclipse.org". I get a similar situation when I create my TOC with an external link to "http://www.eclipse.org". If I use "http://www.eclipse.org" in a hyperlink in a document in my TOC it works fine.
Comment 1 Chris Goldthorpe CLA 2007-05-17 14:57:59 EDT
Eclipse 3.3M5 has the same problem although the symptoms are slightly different:

This is the message I see.

The document that you have requested is not available. The link may be wrong, or you may not have the corresponding product feature installed.

Eclipse 3.2.2 does not exhibit this problem.

Assigning to Adam.
Comment 2 Adam Archer CLA 2007-05-18 09:33:57 EDT
The URL for the toc entry is "http://www.eclipse.org/". When the toc is resolved on GTK, the topic link becomes "http://<local ip address>:<local help port>/www.eclipse.org/".

I am still investigating the cause.
Comment 3 Adam Archer CLA 2007-05-18 09:36:42 EDT
Actually it gets the loopback ip rather than the local ip: "http://127.0.0.1:<local help port>/www.eclipse.org/"
Comment 4 Adam Archer CLA 2007-05-23 19:28:54 EDT
Created attachment 68482 [details]
Patch

The root cause of this was that the href was run through HrefUtil.normalizeDirectoryPath(String href) before it was checked for "http:". This resulted in nasty things happening on platforms that use forward slashes (/) for directory paths. Windows was not affected because it uses back slashes (\).

Macs were actually affected by this bug as well, but Safari appears to be smart enough to accept a URL of "http:/www.eclipse.org" (for example).

The addition of the local loop ip and the local help port only seemed to occur on Linux and only in the webapp. Help view on Linux was getting "http:/www.eclipse.org" and Mac help view and webapp were too.

This patch fixes all of the issues by moving the check for "http:" to before the directory is normalized.
Comment 5 Chris Goldthorpe CLA 2007-05-23 20:07:54 EDT
+1 from me and adding Curtis for review. Patch tested on Linux and XP. 

Comment 6 Curtis d'Entremont CLA 2007-05-23 20:50:09 EDT
Patch looks good.
Comment 7 Chris Goldthorpe CLA 2007-05-24 15:36:08 EDT
Patch was committed this morning.
Comment 8 Adam Archer CLA 2007-06-11 10:04:19 EDT
Verified in I20070608-1718.