GeospatialResearch / gri-earthquake

Other
1 stars 0 forks source link

Postman requests to API get 500 error status #23

Open LukeParky opened 2 years ago

LukeParky commented 2 years ago

Sending requests from Postman causes server to 500 due to logging origin which does not exists

LukeParky commented 2 years ago

| Traceback (most recent call last): api_1 | File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app api_1 | response = self.full_dispatch_request() api_1 | File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request api_1 | rv = self.handle_user_exception(e) api_1 | File "/usr/local/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function api_1 | return cors_after_request(app.make_response(f(*args, kwargs))) api_1 | File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception api_1 | reraise(exc_type, exc_value, tb) api_1 | File "/usr/local/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise api_1 | raise value api_1 | File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request api_1 | rv = self.dispatch_request() api_1 | File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request api_1 | return self.view_functions[rule.endpoint](req.view_args) api_1 | File "/app/src/server/app.py", line 25, in earthquakes api_1 | app.logger.info(request.headers['Origin']) api_1 | File "/usr/local/lib/python3.9/site-packages/werkzeug/datastructures.py", line 1463, in getitem api_1 | return _unicodify_headervalue(self.environ["HTTP" + key]) api_1 | KeyError: 'HTTP_ORIGIN'