NateBrune / Creep

A webservice for displaying nodeinfo information.
3 stars 1 forks source link

Incorrect "Host" http header #16

Closed mk-fg closed 8 years ago

mk-fg commented 8 years ago

I've noticed that "Host" http header seem to be received here in a bit mangled form, which causes e.g. Django to return errors instead of replies for potentially-valid URLs.

Invalid HTTP_HOST header: '[[fc7b:d79a:4eb5:28f6:5686:637d:9f75:5db6]]'. The domain name provided is not valid according to RFC 1034/1035.
...
'HTTP_HOST': '[[fc7b:d79a:4eb5:28f6:5686:637d:9f75:5db6]]',
'HTTP_USER_AGENT': "NAT's Creep nodeinfo.json scanner +https://github.com/NateBrune/Creep",
'PATH_INFO': u'/nodeinfo.json',
...

Given that request gets handled by nginx here, then passed to uwsgi and only then to django, I'm not 100% sure if it's not one of these mangling it, but since there's no issue with other clients, it's likely not the case. Plus should be trivial to test, I guess.

thefinn93 commented 8 years ago

Yep, fixed in #13, may not be deployed everywhere yet, but we're certainly aware of it. Thanks for the feedback!