Fix logic for trimming CloudFront domain