-
-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Labels
Description
When not running on port 80 we encountered a problem where the port number (ex: 8080) was getting dropped and therefore suggest some thing like:
const path = decodeURIComponent(pathname);
await new Promise((resolve, reject) => {
const req = http.request({
method: 'HEAD',
port: port,
host: hostname,
path,
}, ({statusCode, headers}) => {```
instead of
const {origin, hostname, pathname, searchParams} = new URL(url);
const path = decodeURIComponent(pathname);
await new Promise((resolve, reject) => {
const req = http.request({
method: 'HEAD',
host: hostname,
path,
}, ({statusCode, headers}) => {
if (!headers || (statusCode == 200 && !/text\/html/i.test(headers['content-type']))) {
reject(new Error('Not a HTML page'));```
ironically, I don't have easy access to port 80 so haven't tested this much yet, but thought I would raise the issue.
cheers,
Mark