fix permission capping for HTTP/HTTPS

Previously used request scheme, but request scheme is unrelated to
the URL being generated. Instead, base the permission capping on the
scheme of the URL itself.
1 file changed