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

Bug 445693

Summary: [server] WelcomeFileFilter is not working inside an application container
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: ServerAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED WONTFIX QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: 9.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anthony Hunter CLA 2014-10-01 12:22:59 EDT
We have a WelcomeFileFilter that looks for a directory URL ending in / and adds index.html. This is supposed to result in a eventual redirect to edit/edit.html though code in index.js.

This fails in an application container with a content root.

As an example, with a context root of "/code" for orion http://example.com:8080/code should redirect to http://example.com:8080/code/edit/edit.html 

There is an error 404 trying to load https://example.com:8080/requirejs/require.js and as a result you get a white blank page.

http://example.com:8080/code/ does work as it is not using the WelcomeFileFilter.

I should also note that WelcomeFileFilter is processing all of our http request calls on the server, when only one call to / needs this filter, so not sure this is the best design. I cannot find any other place where WelcomeFileFilter is used.
Comment 1 Anthony Hunter CLA 2014-11-20 12:21:43 EST
(In reply to Anthony Hunter from comment #0)
> There is an error 404 trying to load
> https://example.com:8080/requirejs/require.js and as a result you get a
> white blank page.

I raised this bug a while back but its importance is increased. One of our clients went to /code, saw the white blank page, thought the server was down and then restarted the server multiple times.
Comment 2 Anthony Hunter CLA 2015-04-08 11:58:52 EDT
(In reply to Anthony Hunter from comment #0)
> We have a WelcomeFileFilter that looks for a directory URL ending in / and
> adds index.html. This is supposed to result in a eventual redirect to
> edit/edit.html though code in index.js.
> 
> This fails in an application container with a content root.
> 
> As an example, with a context root of "/code" for orion
> http://example.com:8080/code should redirect to
> http://example.com:8080/code/edit/edit.html 
> 
> There is an error 404 trying to load
> https://example.com:8080/requirejs/require.js and as a result you get a
> white blank page.
> 
> http://example.com:8080/code/ does work as it is not using the
> WelcomeFileFilter.

This is not correct. In this case, since the context root is /code we require the setting in orion.conf:
orion.context.path = /code

Once I add this setting the error 404 no longer occurs and the redirect works correctly.

> I should also note that WelcomeFileFilter is processing all of our http
> request calls on the server, when only one call to / needs this filter, so
> not sure this is the best design. I cannot find any other place where
> WelcomeFileFilter is used.

I raised Bug 464179 for this issue, WelcomeFileFilter only handles /.