Skip to content

Commit 4991dd5

Browse files
committed
change exception type and test cases label
1 parent ae7514e commit 4991dd5

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- name: Upload Artifact
7373
uses: actions/upload-artifact@v4
7474
with:
75-
name: guard-lex-${{ matrix.lucee.version }}
75+
name: esapi-lex-${{ matrix.lucee.version }}
7676
path: target/*.lex
7777

7878
- name: Checkout Lucee
@@ -91,7 +91,7 @@ jobs:
9191
luceeVersionQuery: ${{ matrix.lucee.query }}
9292
extensionDir: ${{ github.workspace }}/target
9393
env:
94-
testLabels: guard
94+
testLabels: esapi
9595
testAdditional: ${{ github.workspace }}/tests
9696
LUCEE_ADMIN_PASSWORD: admin
9797

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>org.lucee</groupId>
66
<artifactId>esapi-extension</artifactId>
7-
<version>3.0.0.9-ALPHA</version>
7+
<version>3.0.0.10-ALPHA</version>
88
<packaging>pom</packaging>
99
<name>Guard Extension</name>
1010

source/java/src/org/lucee/extension/guard/util/Canonicalize.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ private static boolean isSafe(char c) {
8787
* @param throwOnMultiple Throw exception if multiple encoding detected
8888
* @return Canonicalized string
8989
* @throws UnsupportedEncodingException
90+
* @throws RuntimeException
91+
* @throws PageException
9092
*/
91-
public static String canonicalize(String input, boolean throwOnMultiple) throws UnsupportedEncodingException {
93+
public static String canonicalize(String input, boolean throwOnMultiple) throws PageException {
9294
if (input == null || input.isEmpty()) {
9395
return input;
9496
}
@@ -136,7 +138,8 @@ public static String canonicalize(String input, boolean throwOnMultiple) throws
136138

137139
// Check if multiple encoding was detected
138140
if (throwOnMultiple && multipleEncodingDetected) {
139-
throw new SecurityException("Multiple encoding layers detected in input: " + input);
141+
throw CFMLEngineFactory.getInstance().getExceptionUtil()
142+
.createSecurityException("Multiple encoding layers detected in input: " + input);
140143
}
141144
return simplify(util.replace(working, placeholder, "+", false, true));
142145
}

tests/Canonicalize.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
component extends="org.lucee.cfml.test.LuceeTestCase" labels="guard" {
1+
component extends="org.lucee.cfml.test.LuceeTestCase" labels="esapi" {
22

33
function run( testResults , testBox ) {
44
describe( title = "Guard: Canonicalize", body = function() {

tests/ESAPIDecode.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
component extends="org.lucee.cfml.test.LuceeTestCase" labels="guard"{
1+
component extends="org.lucee.cfml.test.LuceeTestCase" labels="esapi" {
22
function run( testResults , testBox ) {
33
describe( "test case for guardDecode", function() {
44
it(title = "Checking guardDecode with decodeFrom='html'", body = function( currentSpec ) {

tests/LDEV4009.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
component extends="org.lucee.cfml.test.LuceeTestCase" labels="guard"{
1+
component extends="org.lucee.cfml.test.LuceeTestCase" labels="esapi" {
22

33
function run( testResults, testBox ) {
44
describe("Testcase for LDEV-4009", function() {

tests/LDEV4743.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
component extends="org.lucee.cfml.test.LuceeTestCase" labels="guard" {
1+
component extends="org.lucee.cfml.test.LuceeTestCase" labels="esapi" {
22
function run( testResults , testBox ) {
33
describe( title='Testcase for LDEV-4743' , body=function() {
44

tests/SanitizeHtml.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
component extends="org.lucee.cfml.test.LuceeTestCase" labels="guard" {
1+
component extends="org.lucee.cfml.test.LuceeTestCase" labels="esapi" {
22

33
function run( testResults , testBox ) {
44
describe( title = "Testcase for sanitizeHTML member function", body = function() {

0 commit comments

Comments
 (0)