use beginsWith to match both http and https protocols