-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix(client): don't override protocol for socket connection to 127.0.0.1 #2303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add tests.
Codecov Report
@@ Coverage Diff @@
## master #2303 +/- ##
==========================================
+ Coverage 93.83% 93.84% +<.01%
==========================================
Files 34 34
Lines 1282 1283 +1
Branches 365 366 +1
==========================================
+ Hits 1203 1204 +1
Misses 78 78
Partials 1 1
Continue to review full report at Codecov.
|
Thank you @hiroppy for your fast comment. Looking at the current tests it seams like the serialization of the That makes adding new tests hard since the assertions are arbitrary. Is my assumption correct? Is there a ticket for replacing the snapshot with actual tests? |
I think this line is incorrect.
Currently no. I'll check this. thanks! |
Awesome! let me know when you found the bug. I'm happy to add tests for this PR 😄 |
Will it work for "localhost" too? |
cfce611
to
6142e48
Compare
@odbayar AFAIK it only works with @hiroppy That line is actually correct. The method expects only a query like I updated the tests to pass only the querystring as parameter but that lines are fishy as well: webpack-dev-server/client-src/default/utils/createSocketUrl.js Lines 19 to 22 in 00903f6
which leads to wrong tests like that one: I removed the block since it looks unused and I could not make any sense out of it. Lastly I cleaned some unrelated unit tests to use the correct assertions and refactored the |
6142e48
to
8b0ef4a
Compare
@hiroppy could you please have a second look if the improvements for unit testing make sense? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like big breaking change, why a lot of lines was rewritten? Please avoid unnecessary changes in this PR
@evilebottnawi I understand this change was growing a bit more than expected over time. Please have a look at the individual commits:
Please let me know which change you want in a separate PR or if it's ok to review it as part of this since everything is kind of related. |
@nougad let's do refactor and fix tests in other PRs for better git history and good changelog and then we will return to this PR |
I created two separate PRs with fixing tests and improving assertions:
I will update this PR here one the test fix is merged since it's a prerequisite to have working unit tests. |
/cc @nougad need rebase 👍 |
Chrome and Firefox accept `http://`/`ws://` mixed-content connection to `127.0.0.1` even when the actual website is loaded via `https://`. Fixes webpack#2302
4925b22
to
7a610c2
Compare
@evilebottnawi rebased and updated to only include the one relevant commit. Once merged I will create another PR with the refactoring on top. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything left for this PR? I promise even more extensive testing with the next PR once this one is merged :) nougad@acd46c8 |
thanks |
Could this be expanded to |
Chrome and Firefox accept
http://
/ws://
mixed-content connection to127.0.0.1
even when the actual website is loaded viahttps://
.Fixes #2302
For Bugs and Features; did you add new tests?
I'm not sure if the current tests actually contain correct assertions.
Motivation / Use-Case
described in #2302
Breaking Changes
nope
Additional Info