Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This aims to avoid browser warnings if users accidentally visit a prototype in non-secure mode.
It does this by adding the
Strict-Transport-Security
HTTP header.This will ensure that once a browser has successfully loaded a first page from the domain over https, all subsequent requests will automatically use https, even if the
http://
prefix is typed into the URL bar.I’ve set this to require
NODE_ENV
to be set toproduction
to avoid any issues when running the prototype over localhost. We’d have to add this to the documentation. However many platforms such as Heroku will set this by default for Node.js apps.Once your prototype is running with the header set, you can also submit the domain to https://hstspreload.org/ (although this doesn't work for subdomains) which will ensure the browsers at it to their list of domains to always use https on without even having to visit it first.
Fixes #141
Checklist