| Summary: | Remote help priority checks for null InputStream to determine if Doc is on remote infocenter even though InputStream for Topic Not Found page is returned | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jim Perry <perryja> | ||||||
| Component: | User Assistance | Assignee: | Jim Perry <perryja> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cgold, ChrisAustin, daniel_megert | ||||||
| Version: | 4.0 | Flags: | ChrisAustin:
review+
|
||||||
| Target Milestone: | 3.6 RC1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Jim Perry
Created attachment 166858 [details]
Patch for this issue
Implemented the method:
public boolean isTopicNotFoundStream(URL url)
Which takes a URL and returns true or false based on whether or not that URL will return a stream to the topic not found page. To detect the topic not found page, I use this line:
if(streamContent.indexOf("The topic that you have requested is not available. The link may be wrong, or you may not have the corresponding product feature installed. This online help only includes documentation for features that are installed.")!=-1)//$NON-NLS-1$
{
isTopicNotFoundStream=true;
}
This text is directly from the Topic Not found page. Is there a better way to detect the Topic not found stream? I was thinking maybe we could open a stream to the local topic not found page and compare against that, but those may not be exactly the same depending on the Eclipse release of the platform VS the Eclipse release on the Infocenter.
Also, the method I implemented takes a URL instead of the current InputStream since we do not want to read the current InputStream or else we risk reading the data that the Help System needs from that stream.
Jim - the problem with searching for that String is users can customize the page that displays when a topic is not found - see http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ua_help_setup_preferences.htm That being said, I still don't have a better solution. I don't think that patch will work so well because the not found page could be in a different locale or could be overridden by the user. I'm thinking a better approach would be for calls to /rtopic to return a 404 status rather than returning an error page and check for that status when reading remote help. I haven't thought through all the details, such as backward compatibility issues but it seems that this would be less fragile than searching for specific words in the body of the text. Created attachment 167026 [details]
Patch for Checking if rtopic path when page is not found
This Patch implements the method:
public static boolean isRTopicPath(String servletPath)
which will return true if the request is an rtopic request.
If true, then resp.setStatus(HttpServletResponse.SC_NOT_FOUND); is returned.
If false, the page not found is shown.
Tested and verified that this code will return a null input stream as expected by the remote help code.
Chris A, can you review this for RC1 and commit the patch if you approve it? Patch works for me, committed to HEAD. I have tagged the projects for the next I-build. Jim, do you want to go ahead and create a second bug for the backward compatibility case where the remote infocenter is running on Eclipse 3.5 or earlier? Why is this bug in the Security_Advisories group? This bug is missing a review+. Dani, you are correct - this is not a security bug. I'm guessing that box got checked by accident. |