[Coldbox 5.0.0] double forward slash with buildLink using SES

In the Coldbox SES.cfc intercepter / onRequestCapture function I see this:

// AppMapping for BaseURL Construction
var appMapping = ( len( getSetting( ‘AppMapping’ ) lte 1 ) ? getSetting( ‘AppMapping’ ) & “/” : “” );

// Activate and record the incoming URL for multi-domain hosting
.setSESEnabled( true )
“http” &
( event.isSSL() ? “s” : “” ) &
“://#cgi.HTTP_HOST#/#appMapping#” &
( variables.fullRewrites ? “index.cfm” : “” )

So if my AppMapping setting is blank it sets var AppMapping to “/” (getSetting( ‘AppMapping’ ) & “/”) .

If http_host is yourdomain.com the next section sets SESBaseURL as “http://yourdomain.com//” with two forward slashes on the end (http & ://yourdomain.com & / & /). This SESBaseURL then gets used in RequestContext.cfc for buildLink which causes double forward slashes after domain.

Wondering - is this a bug or should my AppMapping setting never be blank? Or am I completely looking at this wrong?

Thank you!


Check out this pull request that was just merged into the dev branch for ColdBox 5.0.0 two days ago. Does it fix your issue?




ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I don’t believe so. Adding appMapping = left( appMapping, 1 ) == “/” ? appMapping : “/#appMapping#”; still results in appMapping being equal to “/” if that’s what the statement above it set it to so the second part still duplicates the “/”. I pasted in the entire edited cfc and tried it and still the same. Perhaps code elsewhere changed but I don’t think would affect this particular issue…

Can you pull down the latest ColdBox to test that this pull didn’t fix it? install coldbox@be


K, I did. Still the same.

Hmm…my pull may have been missing a piece. I think we need to take out the / between CGI.HTTP_HOST and appMapping.


Thanks. I was wondering about that. Trying to follow the various scenarios that might occur to see if that would work but I’m sure I’m missing some…

If it does, want to make the pull request with what you come up with? Thanks!