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

Add conditional protocol output to serving message #1399

Merged
merged 1 commit into from Mar 25, 2020
Merged

Add conditional protocol output to serving message #1399

merged 1 commit into from Mar 25, 2020

Conversation

SeinopSys
Copy link
Contributor

Description

This fixes the issue where https is configured but the "App serving at" URL in the console is still displayed with the http protocol.

Changes/Tasks

  • Change protocol in "App serving at" message

Motivation and Context

When developing locally one might want to run the application in https to avoid missing mixed content issues for example, or to take advantage of browser features that require HTTPS. Right now it is already possible to configure the app for https operation by using static.config.js:

export default {
  devServer: {
    https: true,
    key: fs.readFileSync('/path/to/localhost.key'),
    cert: fs.readFileSync('/path/to/localhost.crt'),
  },
}

however, once this option is set, the console output remains unchanged due to the currently hard-coded http:// prefix

Types of changes

  • Refactoring/add tests (refactoring or adding test which isn't a fix or add a feature)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have updated the documentation accordingly

    Added a section on how to enable HTTPS for local development so folks don't need to look up how to configure that aspect of the Webpack Dev Server

  • I have updated the CHANGELOG with a summary of my changes
  • My changes have tests around them

This fixes the issue where https is configured but the "App serving at" URL in the console is still displayed with the http protocol
Copy link
Member

@SleeplessByte SleeplessByte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice

@SleeplessByte SleeplessByte merged commit c03b971 into react-static:master Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants