GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
This is a small addition to pull request #7.
If the source url contains a port (e.g. http://example.com:8080) the current implementation generates a redirect to https://example.com:8080 which makes no sense.
This patch makes sure the redirect target contains no port information unless specified through the options, which means it should default to port 443.
make sure the https redirect defaults to 443
If the redirect source url contains a port e.g. (http://example.com:8080) the current implementation generates a redirect to https://example.com:8080 which seems pretty wrong to me in the general use case
You should probably just specify that port as an option.
That would be an solution but the default behavior (without a port) only works when the original request contains no port information (e.g. http://example.com).
As soon as the site was originally requested on a non standard port you get redirected to the same port with protocol 'https'. That makes no sense. Why leave it that way?