Commit 62048851 authored by Gabrecht, Marco's avatar Gabrecht, Marco
Browse files

Update service.py

parent 621fa367
Pipeline #42609 passed with stages
in 1 minute and 37 seconds
......@@ -26,10 +26,10 @@ def index():
def load_url(url, headers):
print(f"Got these headers {dict(headers)}")
h = {}
# h = {
# "User-Agent": headers['User-Agent'],
# "Routing": headers.get('Routing', 'no')
# }
h = {
"User-Agent": headers['User-Agent'],
"Routing": headers.get('Routing', 'no')
}
return json.loads(requests.get(url, headers=h, allow_redirects=True).content)
@app.route('/data')
......@@ -54,4 +54,4 @@ def position():
'data': load_url("http://api.open-notify.org/iss-now.json", request.headers)
})
app.run(host="0.0.0.0", port=80)
\ No newline at end of file
app.run(host="0.0.0.0", port=80)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment