Skip to content

Inject livereload script using location.protocol instead of http:#8718

Merged
jekyllbot merged 1 commit intojekyll:masterfrom
kaysond:master
Jul 23, 2021
Merged

Inject livereload script using location.protocol instead of http:#8718
jekyllbot merged 1 commit intojekyll:masterfrom
kaysond:master

Conversation

@kaysond
Copy link
Copy Markdown
Contributor

@kaysond kaysond commented Jun 27, 2021

This is a 🐛 bug fix.

Summary

If you run jekyll serve --livereload behind an ssl-terminating reverse proxy (or, presumably, using jekyll's own ssl options), the livereload script gets loaded over http. Browsers like Firefox will reject this mixed content load.

Instead of forcing the injection to use http, this change uses location.protocol which dynamically chooses http or https depending on the URL in the browser.

This API is well supported: https://caniuse.com/mdn-api_location_protocol

@DirtyF DirtyF requested review from a team, ashmaroli and mattr- and removed request for a team July 22, 2021 17:47
@DirtyF
Copy link
Copy Markdown
Member

DirtyF commented Jul 23, 2021

@jekyll: merge +fix

@jekyllbot jekyllbot merged commit 9bb98ed into jekyll:master Jul 23, 2021
jekyllbot added a commit that referenced this pull request Jul 23, 2021
github-actions bot pushed a commit that referenced this pull request Jul 23, 2021
Aram Akhavan: use location.protocol to inject the livereload script instead of forcing http (#8718)

Merge pull request 8718
@jekyll jekyll locked and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants