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

Replacing hardcoded protocol in mix helper #18943

Merged
merged 4 commits into from Apr 26, 2017

Conversation

@OwenMelbz
Copy link
Contributor

commented Apr 26, 2017

This does not solve "the whole problem" however currently the mix helper hardcodes the port and protocol.

When using SSL on your development environment browsers refuse to load the assets served by mix when using HMR over http

This change makes sure it uses the correct protocol.

Although it doesn't solve the issue of users not having SSL on "localhost"

OwenMelbz added some commits Apr 26, 2017

Replacing hardcoded protocol in mix helper
This does not solve "the whole problem" however currently the mix helper hardcodes the port and protocol.

When using SSL on your development environment browsers refuse to load the assets served by mix when using HMR over http

This change makes sure it uses the correct protocol.

Although it doesn't solve the issue of users not having SSL on "localhost"
return new HtmlString("http://localhost:8080{$path}");
$hotProtocol = request()->secure() ? 'https' : 'http';
return new HtmlString("{$hotProtocol}://localhost:8080{$path}");

This comment has been minimized.

Copy link
@JosephSilber

JosephSilber Apr 26, 2017

Contributor

You can simply use a protocol-relative URL:

return new HtmlString("//localhost:8080{$path}");

This comment has been minimized.

Copy link
@OwenMelbz

OwenMelbz Apr 26, 2017

Author Contributor

Ha sure, that also works, guess I definitely over engineered that :D

OwenMelbz and others added some commits Apr 26, 2017

@taylorotwell taylorotwell merged commit 9100b42 into laravel:5.4 Apr 26, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/styleci/pr The StyleCI analysis has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.