CGI doesn't work for any ServletRequest Attribute

Description

In Adobe ColdFusion, the cgi scope can be used to access any HTTPServetRequest Attribute. Note the following example assumes you actually have an attribute of this name set. I tested this using the error page handling of my servlet container in CommandBox. Note this ticket or behavior is not specific to CommandBox, I simply used it for an easy test,.

Setup server:

CommandBox> server set web.errorPages.404=404.cfm CommandBox> server set openBrowserURL=/sdfsdf.txt CommandBox> touch 404.cfm --open

Paste this code in the 404.cfm file.

<h1>404.cfm</h1> <cfscript> writeOutput( getPageContext().getRequest().getAttribute( 'javax.servlet.error.request_uri' ) ); writeOutput( cgi['javax.servlet.error.request_uri'] ); </cfscript>

Then start your server

CommandBox> server start

In Adobe ColdFusion, the sdfsdf.txt URI will show up twice, but in Lucee the CGI scope just outputs an empty string.

Activity

Show:

Brad Wood 4 August 2022 at 20:25
Edited

Ran across this again and would be really handy. is there a reason this is still waiting approval? It’s probably just a couple lines of code to implement.

Here’s a much simpler repro case:

https://trycf.com/gist/b5e84a76efe8cd2f3b03abec9d2b6702/acf2021?theme=monokai

The CgiImpl.java class just needs one last check after it looks for an HTTP header where it then looks for a servlet request attribute of that name, and if found, returns it. This has really complicated my CommandBox work adding client cert support. Adobe uses servlet request attributes to allow the AJP connector to add in additional CGI variables by storing all the client cert details in request attributes. But due to Lucee, I’m forced to add all the cert details as HTTP request headers in order to get Lucee to pull them into the cgi scope automatically.

Pothys - MitrahSoft 16 July 2021 at 14:07

I've checked this ticket as per points and yes ACF returns the two texts and Lucee shows only one. In lucee CGI scope returns an empty string.

Details

Assignee

Reporter

Labels

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

Priority

Created 7 July 2021 at 17:57
Updated 4 August 2022 at 20:25

Flag notifications