Fix regression with automatic privileged port binding on Linux

parent e58eeb99
......@@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
Nothing yet.
## [1.0.7] - 2019-02-28
### Fixes
- Fix regression with automatic privileged port binding on Linux.
## [1.0.6] - 2019-02-28
### Changed
......
......@@ -36,7 +36,7 @@ class HttpsServer {
// Starts a static server serving the contents of the passed path at the passed port
// and returns the server.
serve(pathToServe = '.', port = 443, callback = null) {
this.ensureWeCanBindToPort(port)
this.ensureWeCanBindToPort(port, pathToServe)
// If a callback isn’t provided, fallback to a default one that gives a status update.
if (callback === null) {
......@@ -77,7 +77,7 @@ class HttpsServer {
// ===== current app is in index.js and that it can be forked. This might be an issue if a
// process manager is already being used, etc. Worth keeping an eye on and possibly
// making this method an optional part of server startup.
ensureWeCanBindToPort (port) {
ensureWeCanBindToPort (port, pathToServe) {
if (port < 1024 && os.platform() === 'linux') {
const options = {env: process.env}
try {
......
{
"name": "@ind.ie/https-server",
"version": "1.0.6",
"version": "1.0.7",
"description": "HTTPS server that uses nodecert",
"main": "index.js",
"bin": "bin/https-server.js",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment