first POST request after startup results in a 302

Description

It seems the first request processed by Lucee results in a 302 redirect

Lucee 5.3.1.62, Apache 2.4.27, latest mod_cfml and Tomcat 8.5.31.0 (installed via the installer)

Attached is a test case which should be dropped into an existing Apache 2.4 install with mod_cfml
enabled.

1. Extract the zip into C:\lucee\tomcat\webapps\ROOT\request
2. Add the httpd.conf configuration to the existing apache install (exposes C:\lucee\tomcat\webapps\ROOT\ on port 84)
3. Open an Administrator command prompt (use cmd.exe not powershell)
4. Run C:\lucee\tomcat\webapps\ROOT\request\test.bat which will stop and start lucee (which is why it needs to be run as administrator), then make two http requests via curl (sample output below)

the problem is that the first request results in a 302 Location response, subsequent requests don't

Environment

None

Attachments

1

Activity

Zac Spitzer 27 August 2019 at 11:45

there’s a fix! turns out you can return a 307 which tells the browser to resubmit a redirected request with the same method, see for details.

Zac Spitzer 26 June 2019 at 13:38
Edited

yeah, mod_cfml Tomcat Valve does a redirect if the context doesn’t exist and gets created

I filed a bug

 

Damien 26 June 2019 at 13:27

Actually, this might be related to the mod_cfml valve used in server.xml by the Lucee installer.

If I comment out the Valve and replace it with a Context in the Host, I don’t have the issue anymore.

Damien 26 June 2019 at 13:13

I am having the same issue with Lucee 5.2.9.31 on Windows with IIS / BonCode. No matter the initial request (even /index.cfm), I get a 302 redirect to /index.cfm the first time for each domain after a Lucee restart.

See also: https://dev.lucee.org/t/first-call-after-restart-returns-302/491 . Apparently this has been going on for a long time and is probably affecting many people.

Is there a known workaround ?

Zac Spitzer 10 December 2018 at 13:16

actually you can reproduce this with the server admin.

1. open the server admin login page
2. restart lucee
3. enter the password and press submit
4. the login will be ignored (server responds with a 302) and then login form is re-displayed

Unresolved

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 6 September 2018 at 11:18
Updated 28 April 2022 at 01:56