|
> However, my idea is just what's already outlined above: avoid using 'Host', except (perhaps) as a key. Yes, this is a good idea in theory (it's an offshoot of the idea of avoiding using any data that's provided by the browser.) But in practice, it breaks down any time you need to generate a full URL into the site, i.e.: * Callback URLs for schemes like OAuth, webhooks, IPN, etc.
* Transaction emails with links back to the site ("this week on example.com", "joe just mentioned you..." password resets, etc.)
* Links in Atom, RSS feeds, etc. In each case, Django could require that hosts be hardcoded (perhaps in settings) instead of consulting requests, but that would make each of those things harder to use. ... I'm not really trying to have an argument here; I see your point completely and I think I probably agree, personally. But I am trying to point out that security and usability are often at odds, and that there isn't as much a "right answer" as there is a calibration between those two needs. Drawing the line in the right place is hard. |