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: optimize the judgment on whether HTTPS has been set in options #7202

Merged
merged 2 commits into from
Jul 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: fix lint issue
  • Loading branch information
backrunner committed Jun 19, 2022
commit acc81e65f7603012254d6c6eba0b6526633b6528
4 changes: 2 additions & 2 deletions packages/@vue/cli-service/lib/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ module.exports = (api, options) => {
// resolve server options
const modesUseHttps = ['https', 'http2']
const serversUseHttps = ['https', 'spdy']
const optionsUseHttps = modesUseHttps.some(modeName => !!projectDevServerOptions[modeName])
|| (typeof projectDevServerOptions.server === 'string' && serversUseHttps.includes(projectDevServerOptions.server))
const optionsUseHttps = modesUseHttps.some(modeName => !!projectDevServerOptions[modeName]) ||
(typeof projectDevServerOptions.server === 'string' && serversUseHttps.includes(projectDevServerOptions.server))
const useHttps = args.https || optionsUseHttps || defaults.https
const protocol = useHttps ? 'https' : 'http'
const host = args.host || process.env.HOST || projectDevServerOptions.host || defaults.host
Expand Down