add function forms of the host and protocol options #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👋 Not sure if this is something you'd find useful, but IMO limiting the construction of
request.url
to only derive from either theHost
header or a statichost
option (and similarly forprotocol
) is a bit too restrictive for reverse proxy setups.Granted, you could easily just do the work directly on
request.url
that's passed to the handler, but I think being able to specify functions for those options would be the least friction option for servers running behind something like HAProxy or Nginx for HTTPS termination (we actually have multiple reverse proxies in play, so theHost
header that comes along isn't necessarily the one that was sent by the user's browser).From the additions to
README.md
: