_internalRequest() doesn't work with cfcontent

Description

Using _internalRequest(), if the request page has cfcontent with file/variable attribute means it doesn't return any result and aborts the request at the location of internalRequest().

And also _InternalReques() result doesn't include the Content-Type and Content-Length.

// test.cfm <cfcontent type="image/png" file="#expandPath('image.png')#"> // test2.cfm <cfscript> writeoutput("Before _internalrequest()"&"<br>"); result = _internalRequest( template="test.cfm" ); writeoutput("After _internalrequest()"); </cfscript>

Executing test2.cfm

Expected

Before _internalrequest() After _internalrequest()

Actutal

Before _internalrequest()

In addtion I included the stacktrace taken from externally added catch in internalRequest.java
https://github.com/lucee/Lucee/blob/6.0/core/src/main/java/lucee/runtime/functions/system/InternalRequest.java#L108

catch (Exception e) { print.e(e); }

StackTrace

lucee.runtime.exp.PostContentAbort: Page request is aborted at lucee.runtime.tag.Content._doStartTag(Content.java:258) at lucee.runtime.tag.Content.doStartTag(Content.java:156) at test.testcases.test_cfm$cf.call(/test/testcases/test.cfm:6) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1034) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:926) at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:65) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:45) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2460) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2450) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2421) at lucee.runtime.functions.system.InternalRequest.call(InternalRequest.java:124) at test.testcases.test2_cfm$cf.call(/test/testcases/test2.cfm:8) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1034) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:926) at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:65)

Environment

None

Activity

Pothys - MitrahSoft 
22 March 2022 at 11:01

I've checked this ticket with the lucee latest version 5.3.9.115-SNAPSHOT. Now internalRequest() works with cfcontent, cfdocument and abort. Also, argument throwOnError works fine.

Michael Offner 
21 March 2022 at 15:28

we do now catch the abort exception and added the argument “throwonerror“ to catch also regular exception.

if set to false and you have an exception you get a new key “error“ in the resulting struct that contains the catch block.

https://github.com/lucee/Lucee/commit/1edb094b79033e392a97fec26f05c51231dd73c7

Zac Spitzer 
16 March 2022 at 17:59

Pothys - MitrahSoft 
28 February 2022 at 14:54
(edited)

_internalRequest() also didn't works with cfdocument

Zac Spitzer 
19 November 2021 at 18:11
(edited)

Fixed

Details

Assignee

Reporter

Priority

Fix versions

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 15 November 2021 at 11:25
Updated 18 June 2024 at 14:31
Resolved 22 March 2022 at 11:01