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

fix(vite/client): allow ping to http from https website #9561

Merged
merged 1 commit into from Aug 13, 2022
Merged

fix(vite/client): allow ping to http from https website #9561

merged 1 commit into from Aug 13, 2022

Conversation

SamuelAlev
Copy link
Contributor

@SamuelAlev SamuelAlev commented Aug 6, 2022

Description

Allows the ping when running Vite with a HTTP server and the website with the client is running a HTTPS server.

Additional context

When using Vite and the server.hmr.protocol parameter set to ws, the Vite client will try to ping the server with current website protocol, which could be incorrect when having the Vite client on a HTTPS website and the Vite server running HTTP.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@SamuelAlev SamuelAlev changed the title fix: allow ping to http from https fix(vite/client): allow ping to http from https website Aug 6, 2022
@patak-dev
Copy link
Member

Thanks for the fix @SamuelAlev. @sapphi-red, would it make sense to ask contributors of this kind of PRs to send a test case to https://github.com/sapphi-red/vite-setup-catalogue so we can avoid regressions in the future? Maybe we could add a section the CONTRIBUTING.md about this.

@patak-dev patak-dev added feat: hmr p3-minor-bug An edge case that only affects very specific usage (priority) labels Aug 8, 2022
@sapphi-red
Copy link
Member

Currently vite-setup-catalogue's structure is not suitable to write many tests. I'll change that the following week. After that, I think it would make sense. For this PR, I'll create a test case during the refactor.

@patak-dev patak-dev merged commit f4b4405 into vitejs:main Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: hmr p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants