File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
projects/angular-token/src/lib Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -431,15 +431,21 @@ export class AngularTokenService implements CanActivate {
431
431
return ( this . userType . value == null ) ? '' : this . userType . value . path + '/' ;
432
432
}
433
433
434
+ private addTrailingSlashIfNeeded ( url : string ) : string {
435
+ const lastChar = url [ url . length - 1 ] ;
436
+
437
+ return lastChar === '/' ? url : url + '/' ;
438
+ }
439
+
434
440
private getApiPath ( ) : string {
435
441
let constructedPath = '' ;
436
442
437
443
if ( this . options . apiBase != null ) {
438
- constructedPath += this . options . apiBase + '/' ;
444
+ constructedPath += this . addTrailingSlashIfNeeded ( this . options . apiBase ) ;
439
445
}
440
446
441
447
if ( this . options . apiPath != null ) {
442
- constructedPath += this . options . apiPath + '/' ;
448
+ constructedPath += this . addTrailingSlashIfNeeded ( this . options . apiPath ) ;
443
449
}
444
450
445
451
return constructedPath ;
You can’t perform that action at this time.
0 commit comments