Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use https link for API docs #180

Merged
merged 1 commit into from
May 29, 2023
Merged

Conversation

jgaskins
Copy link
Contributor

Linking to the https site mostly to avoid the "Not Secure" warning in my browser, but also because it's a good idea

@z64
Copy link

z64 commented May 29, 2023

I'm seeing that the current deployment of /latest/ serves a redirect to http.

$ curl https://crystal-lang.github.io/crystal-db/api/latest/
<!DOCTYPE html>
<html lang="en-US">
  <meta charset="utf-8">
  <title>Redirecting&hellip;</title>
  <link rel="canonical" href="http://crystal-lang.github.io/crystal-db/api/0.11">
  <script>location="http://crystal-lang.github.io/crystal-db/api/0.11"</script>
  <meta http-equiv="refresh" content="0; url=http://crystal-lang.github.io/crystal-db/api/0.11">
  <meta name="robots" content="noindex">
  <h1>Redirecting&hellip;</h1>
  <a href="http://crystal-lang.github.io/crystal-db/api/0.11">Click here if you are not redirected.</a>
</html>

Once you have landed on the 0.11.0 page though, that can be served over https. I'm unfamiliar with GHP, but it seems something related to the latest redirect needs to be configured/updated.

@bcardiff bcardiff merged commit 65b926c into crystal-lang:master May 29, 2023
@bcardiff
Copy link
Member

I've enabled "Enforce HTTPS" that generates an http -> https redirect on GHP.

Still jekyll-redirect-from seems to generate redirects with http. If the browser still complains we might get around it setting up the site.url property according to https://github.com/jekyll/jekyll-redirect-from#prefix so the redirect will be to an https url.

If site.url is set, its value, together with site.baseurl, is used as a prefix for the redirect url automatically. This is useful for scenarios where a site isn't available from the domain root, so the redirects point to the correct path. If site.url is not set, only site.baseurl is used, if set.

Note: If you are hosting your Jekyll site on GitHub Pages, and site.url is not set, the prefix is set to the pages domain name i.e. http://example.github.io/project or a custom CNAME.

@jgaskins jgaskins deleted the patch-1 branch May 30, 2023 01:09
@jgaskins
Copy link
Contributor Author

Thanks @bcardiff! Between these two changes, it looks like the link in the readme goes to an https site now. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants