izaakschroeder/express-secure-only — pull request #3 by nfriedly (2014-12-16 22:16:36+00:00)
Title: Fixes for status code, host, tests

So, there were a couple of issues lurking:

* 403 status code on redirects rather than the expected 302 (and the tests enforced 403)
* I wanted to test locally on non-standard ports, so I added support for `options.host`. (And changed `req.get('Host')` to `req.hostname` because the former includes the HTTP port number if it was present in the original request.)

I also switched to just plain string concatenation.. I know using the URL lib is generally safer, but this is simpler and I can't think of any scenario where this would provide an incorrect URL. (Except in the case of a bad `host` config - but that would break `url.format` also.)

Finally, I added an example with `options.host` to the readme, updated the tests to cover it, and simplified the tests a little bit by using the built-in superagent expectations.