From 2f2901eb3b27490726221b25fb44fe2ed9d44a47 Mon Sep 17 00:00:00 2001 From: Roddy Bykov Date: Thu, 10 Sep 2026 00:16:00 +0200 Subject: [PATCH 1/2] Fixed http error in test suite --- .gitignore | 4 ++++ box.json | 6 ++--- examples/rest/controllers/main.cfc | 9 ++++++++ tests/rest/DecodeTest.cfc | 35 ++++++++++++++++++++++++------ 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 37ef4a1b..1e2a9e70 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ settings.xml *.ipr *.idea run-tests.sh +.github +.junie +.claude +.vscode \ No newline at end of file diff --git a/box.json b/box.json index 6bcf7115..2ea1f80e 100644 --- a/box.json +++ b/box.json @@ -51,14 +51,12 @@ "url":"https://github.com/framework-one/fw1/graphs/contributors" } ], - "ignore":[ - - ], + "ignore":[], "devDependencies":{ "testbox":"2.5.0+107" }, "installPaths":{ - "testbox":"testbox" + "testbox":"testbox/" }, "testbox":{ "runner":"http://localhost:8500/tests/runner.cfm" diff --git a/examples/rest/controllers/main.cfc b/examples/rest/controllers/main.cfc index 1fd6e1b3..aa53106e 100644 --- a/examples/rest/controllers/main.cfc +++ b/examples/rest/controllers/main.cfc @@ -5,6 +5,15 @@ component { return this; } + function get( struct rc, struct headers ) { + var response = { + "method": "GET", + "multi": rc.multi, + "single": rc.single + }; + variables.fw.renderData().type( 'json' ).data( response ); + } + function patch( struct rc, struct headers ) { var response = { "method": "PATCH", diff --git a/tests/rest/DecodeTest.cfc b/tests/rest/DecodeTest.cfc index 06742ef4..bc525ead 100644 --- a/tests/rest/DecodeTest.cfc +++ b/tests/rest/DecodeTest.cfc @@ -1,5 +1,12 @@ component extends="mxunit.framework.TestCase" { + function testURLEncodedRequestDecodesMultiField() { + var actual = doURLEncodedHTTPRequest( "GET" ); + assertEquals( "GET", actual.method ); + assertEquals( "a,b,c", actual.single ); + assertEquals( "1,2,3,40,50", actual.multi ); + } + function testPostFormEncodedRequestDecodesMultiField() { var actual = doFormEncodedHTTPRequest( "POST" ); assertEquals( "POST", actual.method ); @@ -47,19 +54,33 @@ component extends="mxunit.framework.TestCase" { private function doFormEncodedHTTPRequest( verb ) { return doHTTPRequest( verb, "application/x-www-form-urlencoded", "multi=1%2C2%2C3&multi=40&multi=50&single=a%2Cb%2Cc" ); } + + private function doURLEncodedHTTPRequest( verb ) { + return doHTTPRequest( verb, "application/x-www-form-urlencoded", "&multi=1%2C2%2C3&multi=40&multi=50&single=a%2Cb%2Cc" ); + } private function doJSONEncodedHTTPRequest( verb ) { return doHTTPRequest( verb, "application/json", '{"multi": "1,2,3,40,50","single": "a,b,c"}' ); } private function doHTTPRequest( verb, contentType, body ) { - var httpService = new http(); - httpService.setmethod( verb ); - httpService.setCharset( "utf-8" ); - httpService.setUrl( "http://#CGI.SERVER_NAME#:#CGI.SERVER_PORT#/examples/rest/?action=main.#verb#" ); - httpService.addParam( type = "header", name = "content-type", value = contentType ); - httpService.addParam( type = "body", value = body ); - var response = httpService.send().getPrefix().filecontent; + + if (verb eq "GET") { + http method="#verb#" charset="utf-8" url="http://#CGI.SERVER_NAME#:#CGI.SERVER_PORT#/examples/rest/" result="httpResult" { + httpparam type="url" name="action" value="main.#verb#"; + httpparam type="url" name="multi" value="1,2,3"; + httpparam type="url" name="multi" value="40"; + httpparam type="url" name="multi" value="50"; + httpparam type="url" name="single" value="a,b,c"; + } + } else { + http method="#verb#" charset="utf-8" url="http://#CGI.SERVER_NAME#:#CGI.SERVER_PORT#/examples/rest/?action=main.#verb#" result="httpResult" { + httpparam type="header" name="content-type" value="#contentType#"; + httpparam type="body" value="#body#"; + } + } + + var response = httpResult.filecontent; if ( isJson( response ) ) { return deserializeJSON( response ); } From a6b934d8bf6debaf4a8e5b30ee27cead97f5e13b Mon Sep 17 00:00:00 2001 From: Roddy Bykov Date: Tue, 15 Sep 2026 10:51:50 +0200 Subject: [PATCH 2/2] Lucee bump --- server.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.json b/server.json index a959a464..20941b6d 100644 --- a/server.json +++ b/server.json @@ -1,6 +1,6 @@ { "app":{ - "cfengine":"lucee@5" + "cfengine":"lucee@6" }, "web":{ "http":{