Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355810 - [Webapp] Eclipse Help System does not send the HTTP 404 response code when a topic is missing
Summary: [Webapp] Eclipse Help System does not send the HTTP 404 response code when a ...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: platform-ua-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-25 05:36 EDT by Eero Helenius CLA
Modified: 2020-03-25 05:17 EDT (History)
6 users (show)

See Also:


Attachments
A screenshot of the Network tab of Chrome developer tools. (319.66 KB, image/png)
2011-08-25 05:37 EDT, Eero Helenius CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eero Helenius CLA 2011-08-25 05:36:12 EDT
Build Identifier: 3.7

The Eclipse Help system returns response code 200 even though a resource is NOT found.

This is causes a problem with search engine spiders and link checking tools such as the W3C Link Checker (http://validator.w3.org/checklink), which will never report a broken link because missing pages don't send it a 404.

I'm not 100% sure this is caused solely by the Eclipse Help system or if it has to do with web server configuration, but I'm hoping you might be able to shed some light on the matter.

Reproducible: Always

Steps to Reproduce:
1. Open the Net tab in Firebug or the Network tab in Chrome developer tools.
2. Open any topic that doesn't exist in the document set. For example: http://help.eclipse.org/indigo/index.jsp?topic=%2Fthis-does-not-exist.html
3. Check the HTTP response code.
Comment 1 Eero Helenius CLA 2011-08-25 05:37:20 EDT
Created attachment 202130 [details]
A screenshot of the Network tab of Chrome developer tools.

As you can see, the response code is 200 even though the topic clearly doesn't exist.
Comment 2 Chris Goldthorpe CLA 2011-08-25 12:27:14 EDT
There is a preference which can be used to cause the help system to return a 404 status instead of the error page: It is org.eclipse.help.base/page_not_found and if set to an empty string a 404 code will be returned for any broken links.

See http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/guide/ua_help_setup_preferences.htm
Comment 3 Eero Helenius CLA 2011-08-26 03:33:28 EDT
(In reply to comment #2)
> There is a preference which can be used to cause the help system to return a
> 404 status instead of the error page: It is
> org.eclipse.help.base/page_not_found and if set to an empty string a 404 code
> will be returned for any broken links.
> 
> See
> http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/guide/ua_help_setup_preferences.htm

Thanks, that works!

That tip might be worth mentioning explicitly on the page you linked, too.

However, if you define a custom 404 page (something like this: org.eclipse.help.base/page_not_found=/customization/404.html), the Eclipse Help system won't return a 404 code but a 200 OK code.

Would it be possible to make the Eclipse Help system return a 404 when a custom 404 page is defined?

Thanks again for the tip!
Comment 4 Chris Goldthorpe CLA 2011-08-26 11:52:33 EDT
(In reply to comment #3)
> 
> However, if you define a custom 404 page (something like this:
> org.eclipse.help.base/page_not_found=/customization/404.html), the Eclipse Help
> system won't return a 404 code but a 200 OK code.
> 
> Would it be possible to make the Eclipse Help system return a 404 when a custom
> 404 page is defined?
> 

I recall there was some reason for not doing that. I would have to look at the history of the bug report which added the 404 status to see if I can find out more information.
Comment 5 Chris Goldthorpe CLA 2011-08-26 12:17:01 EDT
I saw this comment one one commit to EclipseConnector.java:

Stopped setting 404 status when an error page is presented because some custom pages would not display unless the status was OK.

As I recall for a while 404 was returned for all broken links, even if the error page was defined but it caused unwanted side effects and was backed out. I'm resolving this bug as as WONTFIX because I don't want to reinrtoduce any side effects.
Comment 6 Eero Helenius CLA 2011-08-29 02:17:56 EDT
(In reply to comment #5)
> I saw this comment one one commit to EclipseConnector.java:
> 
> Stopped setting 404 status when an error page is presented because some custom
> pages would not display unless the status was OK.
> 
> As I recall for a while 404 was returned for all broken links, even if the
> error page was defined but it caused unwanted side effects and was backed out.
> I'm resolving this bug as as WONTFIX because I don't want to reinrtoduce any
> side effects.

Hi Chris,

That's understandable.

Thanks for the earlier tip, nonetheless, it's quite sufficient for our purposes for now.
Comment 7 Markus Keller CLA 2015-06-03 11:48:54 EDT
Reopening, since

a) not returning a 404 is just wrong

b) the wrong default and the
        org.eclipse.help.base/page_not_found=""
   hack are not described in the ua_help_setup_preferences.htm doc

c) no reason was given for why the broken behavior would help anyone.

Looks like this was once fixed with bug 68518 but then http://git.eclipse.org/c/platform/eclipse.platform.ua.git/commit/?id=5fc81f08b2431c2af7df9794eff86f178d0a9d57 reintroduced the bug without any explanation

I think we should just revert that commit (and its child commit).
Comment 8 Markus Keller CLA 2015-06-03 11:57:38 EDT
Here's the concrete workaround (tested in 4.5):

* Create file "<path-to-your>/pluginCustomization.ini" with contents:

# hack around Bug 355810: [Webapp] Eclipse Help System does not send the HTTP 404 response code when a topic is missing
org.eclipse.help.base/page_not_found=""


* Add this your command line / eclipse.ini: 

-pluginCustomization <path-to-your>/pluginCustomization.ini
Comment 9 Lars Vogel CLA 2016-05-12 05:10:02 EDT
Moving to 4.7. Please move back to 4.6 RC2 if you think that is important enough and if you plan to provide a Gerrit review..
Comment 10 Eclipse Genie CLA 2020-03-25 05:17:37 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. 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.