You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The official `git-scm.com` website is currently built by Hugo with
`--baseURL http://git-scm.com/`. This commit allows changing the URL
scheme to `https`, in order to avoid unnecessary redirects between
HTTPS and unencrypted HTTP.
Such redirects occur when one of the following URLs is requested:
* URLs in `layouts/alias.html`, e.g. in <https://git-scm.com/docs/>
* Image URLs in <https://git-scm.com/application.min.css>
* Endpoint URLs in <https://git-scm.com/sitemap.xml>
Since these URLs have the `http` scheme, the client is supposed to send
the new request unencrypted, only to be told by the server to use HTTPS
again. Modern web browsers tend to stick with HTTPS in certain cases,
so the downgrade may not always happen, but it's better to eliminate
the redirects nevertheless, for security and performance reasons.
Instead of trying to use relative URLs everywhere, this commit takes a
simpler approach by using the `https` scheme in the base URL. One way
to do this is to enable the "Enforce HTTPS" option in the GitHub Pages
settings, but it's infeasible because the `git-scm.com` domain points to
Cloudflare instead of GitHub.
Therefore, this commit introduces a GitHub Actions variable,
`EXTERNAL_HTTPS`, which can be set to true if HTTPS is provided by a
third party, so that the URL scheme can be safely overridden. This also
generalizes the special case of `git-scm.com` for any domain with a
similar setup, allowing tests to be run more reliably in a uniform way.
See-also: c22a1a5 (deploy(playwright): work around externally-enforced HTTPS, 2024-10-07)
See-also: d4f88c1 (deploy: be more careful when auto-upgrading from HTTP -> HTTPS, 2024-10-07)
0 commit comments