Fix a bug in URL redirection so that ndcode.org (without www) works again
authorNick Downing <nick@ndcode.org>
Sat, 4 Sep 2021 03:11:02 +0000 (23:11 -0400)
committerNick Downing <nick@ndcode.org>
Sat, 4 Sep 2021 03:11:02 +0000 (23:11 -0400)
Server.js

index 1c2cc2b..954fcf0 100644 (file)
--- a/Server.js
+++ b/Server.js
@@ -271,7 +271,7 @@ Server.prototype.respond = async function(request, response, protocol) {
     switch (host.type) {
     case 'redirect':
       let new_host = host.host
-      if (parsed_url.port !== undefined)
+      if (parsed_url.port !== null)
         new_host += ':' + parsed_url.port
       this.redirect(
         response,