Allow using URL with wildcard (*) as the cname for the app

Also, add a test for invalid cname.

Please review and comment :wink: