knatten / cppquiz

Source for the http://cppquiz.org website (not the questions)
GNU General Public License v3.0
101 stars 14 forks source link

Stop spamming about invalid http hosts #330

Closed knatten closed 7 months ago

knatten commented 7 months ago

After moving to the new server where everyone can reach the IP/port that Django itself is running on, we get a bunch of errors like these whenever someone tries to use an invalid host:

[Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '(...)'. You may need to add '(...)' to ALLOWED_HOSTS.

There's no point in looking at these, the only allowed host we care about is already configured. And since we don't control the http server, we can't block these requests before they hit Django.