I would suggest to do a check here if the schema is https. Reasoning is that this method also supports "custom" url's.
Maybe something like `if source.scheme == 'https'`