@@ -157,15 +157,6 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
157157 arguments .event .setSESBaseURL ( variables .router .composeRoutingUrl () );
158158 }
159159
160- // Check for invalid URLs if in strict mode via unique URLs
161- if ( variables .router .getUniqueURLs () ) {
162- checkForInvalidURL (
163- cleanedPaths [ " pathInfo" ],
164- cleanedPaths [ " scriptName" ],
165- arguments .event
166- );
167- }
168-
169160 // Extension detection if enabled, so we can do cool extension formats
170161 if ( variables .router .getExtensionDetection () ) {
171162 cleanedPaths [ " pathInfo" ] = detectExtension ( cleanedPaths [ " pathInfo" ], arguments .event );
@@ -888,98 +879,6 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
888879 return returnString ;
889880 }
890881
891- /**
892- * Check for invalid URL's
893- *
894- * @route The incoming route
895- * @script_name The cgi script name
896- * @event The event object
897- */
898- private function checkForInvalidURL (
899- required route ,
900- required script_name ,
901- required event
902- ){
903- var handler = " " ;
904- var action = " " ;
905- var newpath = " " ;
906- var rc = event .getCollection ();
907-
908- /**
909- Verify we have uniqueURLs ON, the event var exists, route is empty or index.cfm
910- AND
911- if the incoming event is not the default OR it is the default via the URL.
912- **/
913- if (
914- structKeyExists ( rc , variables .eventName )
915- AND
916- ( arguments .route EQ " /index.cfm" or arguments .route eq " " )
917- AND
918- (
919- rc [ variables .eventName ] NEQ variables .defaultEvent
920- OR
921- ( structKeyExists ( url , variables .eventName ) AND rc [ variables .eventName ] EQ variables .defaultEvent )
922- )
923- ) {
924- // New Pathing Calculations if not the default event. If default, relocate to the domain.
925- if ( rc [ variables .eventName ] ! = variables .defaultEvent ) {
926- // Clean for handler & Action
927- if ( structKeyExists ( rc , variables .eventName ) ) {
928- handler = reReplace ( rc [ variables .eventName ], " \.[^.]*$" , " " );
929- action = listLast ( rc [ variables .eventName ], " ." );
930- }
931- // route a handler
932- if ( len ( handler ) ) {
933- newpath = " /" & handler ;
934- }
935- // route path with handler + action if not the default event action
936- if ( len ( handler ) && len ( action ) ) {
937- newpath = newpath & " /" & action ;
938- }
939- }
940-
941- // Debugging
942- if ( variables .log .canDebug () ) {
943- variables .log .debug (
944- " SES Invalid URL detected. Route: #arguments .route #, script_name: #arguments .script_name #"
945- );
946- }
947-
948- // Setup Relocation
949- var httpRequestData = getHTTPRequestData ();
950- var relocationUrl = " #arguments .event .getSESbaseURL () ##newpath ##serializeURL ( httpRequestData .content , arguments .event ) #" ;
951-
952- if ( httpRequestData .method eq " GET" ) {
953- cflocation ( url = relocationUrl , statusCode = 301 );
954- } else {
955- cflocation ( url = relocationUrl , statusCode = 303 );
956- }
957- }
958- }
959-
960- /**
961- * Serialize a URL when invalid
962- *
963- * @formVars The incoming form variables
964- * @event The event object
965- */
966- private function serializeURL ( formVars = " " , required event ){
967- var vars = arguments .formVars ;
968- var rc = arguments .event .getCollection ();
969-
970- for ( var key in rc ) {
971- if ( NOT listFindNoCase ( " route,handler,action,#variables .eventName #" , key ) ) {
972- vars = listAppend ( vars , " #lCase ( key ) #=#rc [ key ] #" , " &" );
973- }
974- }
975-
976- if ( len ( vars ) eq 0 ) {
977- return " " ;
978- }
979-
980- return " ?" & vars ;
981- }
982-
983882 /**
984883 * Clean up some IIS funkyness where query string is found in the path info. We basically clean it up and add the query string into the RC scope
985884 *
0 commit comments