Title:
isValid("url") throws uncatch-able exception error if URL is too long (Java11)
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): James M. / ()
Created: 05/21/2019
Components: Language, Validation
Versions: 2016,2018
Failure Type: Crash
Found In Build/Fixed In Build: 2016,0,10,314028 / CF2016U12,CF2018U5
Priority/Frequency: Normal / Most users will encounter
Locale/System: English / Win 2016
Vote Count: 0
Problem Description:
When using Java11, URLs that exceed ~1560 characters cause ColdFusion to throw a show-stopping exception error and abort processing.
Steps to Reproduce:
Full sample source code available here:
https://gist.github.com/JamoCA/c84892f8d1da741d28f985be9227a60e
Generate a long URL and attempt to validate it using isValid("url").
Actual Result:
Unhandled Exception
Expected Result:
A boolean true or false
Any Workarounds:
Don't use the built-in function. Use your UDF.
<cfscript>
function isURL(u){
var response = true;
var test = {};
try {
test = jURL.Init( javacast("string", arguments.u) );
} catch(any e) {
response = false;
}
return response;
}
</cfscript>
Attachments:
Comments: