From 69bfa829065f596a45ebbc31e6d9d26c50a84c55 Mon Sep 17 00:00:00 2001 From: Roman Chyla Date: Mon, 1 Jun 2020 20:50:53 -0400 Subject: [PATCH] Made the service configurable; to serve with service token --- authoraffsrv/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authoraffsrv/utils.py b/authoraffsrv/utils.py index 147d65b..d296c4b 100644 --- a/authoraffsrv/utils.py +++ b/authoraffsrv/utils.py @@ -24,10 +24,11 @@ def get_solr_data(bibcodes, cutoff_year, start=0, sort='date desc'): } headers = { - 'Authorization': request.headers.get('X-Forwarded-Authorization', request.headers.get('Authorization', '')), + 'Authorization': current_app.config.get('SERVICE_TOKEN', request.headers.get('X-Forwarded-Authorization', request.headers.get('Authorization', ''))), 'Content-Type': 'big-query/csv', } + try: response = client().post( url=current_app.config['AUTHOR_AFFILIATION_SOLRQUERY_URL'],