Verified Commit aeae3c81 authored by Aral Balkan's avatar Aral Balkan
Browse files

Minor refactoring for code clarity

parent ca2cb1a5
......@@ -30,8 +30,12 @@ class WebServer {
// Note: if you pass in a key and cert in the options object, they will not be
// ===== used and will be overwritten.
createServer (options = {}, requestListener = undefined) {
if (options.global) {
delete options.global // Let’s be nice and not pollute that object.
// Let’s be nice and not continue to pollute the options object.
const requestsGlobalCertificateScope = options.global === true
if (options.global !== undefined) { delete options.global }
if (requestsGlobalCertificateScope) {
return this._createTLSServerWithGloballyTrustedCertificate (options, requestListener)
} else {
// Default to using local certificates.
......
{
"name": "@ind.ie/web-server",
"version": "6.0.0",
"version": "6.0.1",
"description": "A secure and seamless Small Tech personal web server.",
"main": "index.js",
"bin": "bin/web-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