adds origin headers to RESTful integration tests

This commit is contained in:
Aaron Blankstein
2017-07-18 14:58:48 -04:00
parent 657a1a578d
commit 3997e3639e

View File

@@ -2226,8 +2226,11 @@ def blockstack_REST_call( method, route, session, api_pass=None, app_fqu=None, a
headers = {}
if session:
headers['authorization'] = 'bearer {}'.format(session)
app_domain = jsontokens.decode_token(session)["payload"]["app_domain"]
headers['origin'] = "http://{}".format(app_domain)
elif api_pass:
headers['authorization'] = 'bearer {}'.format(api_pass)
headers['origin'] = 'http://localhost:3000'
assert not (data and raw_data), "Multiple data given"