AllowedHost check wildcard for subdomains
pzeinlinger opened this issue · 3 comments
pzeinlinger commented
In my opinion, the if clause for the host check should rather be implemented with a regular expression, since e.g. wildcards are often used to allow subdomains.
What's your point of view on this issue? Should I open a pull request?
unrolled commented
I think that's a valid point. If you can implement it with backwards compatibility that would be awesome!
pzeinlinger commented
I opted for a new options flag, because just changing the string check to a regex match would essentially compromise security (e.g. sub1example.com would come back valid for sub.example.com).
The implementation uses regex compile to speed up checks.
unrolled commented
Thanks for putting this together!