Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
webob port validation #271
My first impulse was to put it under to make sure that the resulting exception can be caught in a view. But since it's a bad request we really shouldn't be touching it anyhow, so I'm now changing my vote to 'over' :)
I think we might just want to do what Django does and match the host header against a regex:
It's well tested and it doesn't come with a real performance downside as most of the time we would just check the same host over and over again, which is fine since Python caches regex matches internally up to a point.