Commit ab22aeb2 authored by Schultz, Lucian's avatar Schultz, Lucian
Browse files

load_url in service.py edited

parent 72d42e58
Pipeline #42697 passed with stages
in 1 minute and 53 seconds
......@@ -5,7 +5,7 @@ import socket
import json
# A very boring and basic space-service to demonstrate
# content-based traffic management.
# content-based traffic management.
role = os.environ.get('ROLE', 'data')
astros_svc = os.environ.get("ASTROS_SVC", "astros")
......@@ -25,11 +25,11 @@ 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 = {}
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')
......
Supports Markdown
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