Fix corner case in https detection