modilabs/enketo — pull request #320 by scornflakes (2013-02-07 11:38:06+00:00)
Title: make subdomain generation and redirection work with non-default ports

Hey,

I substituted HTTP_HOST with SERVER_NAME where used because the former can be manipulated by the client
it could be cleaned up more to minimise code duplication, I wanted to get it to work first and I have to delve a little deeper into CIs structure to do that.
but we could probably do more with the the subdomain helper in the survey model?