TypeError: argument of type 'NoneType' is not iterable
daurnimator opened this issue · comments
2020-07-31 21:53:19 ERROR:tornado.access:500 HEAD / (10.244.0.20) 3.94ms
2020-07-31 21:53:19 TypeError: argument of type 'NoneType' is not iterable
2020-07-31 21:53:19 if 'curl' in useragent and not request.is_secure:
2020-07-31 21:53:19 File "server.py", line 186, in root
2020-07-31 21:53:19 return self.view_functions[rule.endpoint](**req.view_args)
2020-07-31 21:53:19 File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
2020-07-31 21:53:19 rv = self.dispatch_request()
2020-07-31 21:53:19 File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
2020-07-31 21:53:19 raise value
2020-07-31 21:53:19 File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
2020-07-31 21:53:19 reraise(exc_type, exc_value, tb)
2020-07-31 21:53:19 File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
2020-07-31 21:53:19 return original_handler(e)
2020-07-31 21:53:19 File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
2020-07-31 21:53:19 rv = self.handle_user_exception(e)
2020-07-31 21:53:19 File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
2020-07-31 21:53:19 response = self.full_dispatch_request()
2020-07-31 21:53:19 File "/root/.local/share/virtualenvs/app-ueEJiAOq/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
2020-07-31 21:53:19 Traceback (most recent call last):
2020-07-31 21:53:19 ERROR:server:Exception on / [HEAD]
I'm not sure whether or not we should change this to a KeyError, which would be a 500 implying every request should include a User-Agent header. or instead check for None and if User-Agent isn't provided, raise a 400.
empty is not curl.... we should just default to the happy path.
That is a good point, please excuse what was apparently a moment of my brain apparently being deep-fried. I'll push a fix soon.
Fixed in current version, guessing @RyanSquared forgot to close the issue.