Skip to content

Commit

Permalink
LDEV-3349 improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Dec 2, 2024
1 parent 3970382 commit e25ff47
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
48 changes: 40 additions & 8 deletions test/tickets/LDEV3349.cfc
Original file line number Diff line number Diff line change
@@ -1,50 +1,82 @@
component extends="org.lucee.cfml.test.LuceeTestCase" skip=true {
component extends="org.lucee.cfml.test.LuceeTestCase" {
function run( testResults, testBox ){

describe( "checking query string encoding for spaces", function() {
variables.uri = createURI("LDEV3349/test.cfm");
variables.uri = createURI("LDEV3349/ldev3349.cfm");

it( title="cfhttp with queryString %20", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: "%20"
);
expect(result.filecontent).toBe("%20");
expect(result.filecontent).toBe(" =");
});
it( title="cfhttp with queryString space", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: " "
);
expect(result.filecontent).toBe("%20");
expect(result.filecontent).toBe(" =");
});
it( title="cfhttp with queryString +", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: "+"
);
expect(result.filecontent).toBe("%20");
expect(result.filecontent).toBe(" =");
});
it( title="cfhttp with queryString +%20", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: "+%20"
);
expect(result.filecontent).toBe("%20%20");
expect(result.filecontent).toBe(" =");
});
it( title="cfhttp with queryString %2B+%2B", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: "%2B+%2B"
);
expect(result.filecontent).toBe("%2B%20%2B");
expect(result.filecontent).toBe("+ +=");
});
it( title="cfhttp with queryString space1space", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: " 1 "
);
expect(result.filecontent).toBe("%2B%20%2B");
expect(result.filecontent).toBe(" 1 =");
});

it( title="cfhttp with queryString a=?", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: "a=?" // ? is a reserved character and will be converted to %3F encoding
);
expect(result.filecontent).toBe("a=?");
});

it( title="cfhttp with queryString a=?&b=+", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: "a=?&b=+" // ? is a reserved character and will be converted to %3F encoding
);
expect(result.filecontent).toBe("a=?&b= ");
});

it( title="cfhttp with queryString a=%3F&b= ", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: "a=%3F&b=+"
);
expect(result.filecontent).toBe("a=?&b= ");
});

it( title="LDEV-5172 azure blob url problem", body=function( currentSpec ){
local.result = _internalRequest(
template: variables.uri,
url: "rscd=attachment%3B+filename%3D%22results.zip%22"
);
expect( result.filecontent ).toBe( 'rscd=attachment; filename="results.zip"' );
});
});
}
Expand Down
1 change: 1 addition & 0 deletions test/tickets/LDEV3349/ldev3349.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<cfoutput>#urlDecode(getPageContext().getRequest().getQueryString())#</cfoutput>
1 change: 0 additions & 1 deletion test/tickets/LDEV3349/test.cfm

This file was deleted.

0 comments on commit e25ff47

Please sign in to comment.