Skip to content

Commit

Permalink
[Hardening] Do not overwrite 'Authorization' header if already exists…
Browse files Browse the repository at this point in the history
… on the request headers
  • Loading branch information
afabiani committed Jun 10, 2020
1 parent bdf3cab commit cf07a41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion geonode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def get_headers(request, url, raw_url, allowed_hosts=[]):
else:
access_token = get_or_create_token(request.user)

if access_token:
if 'Authorization' not in headers and access_token:
headers['Authorization'] = 'Bearer %s' % access_token

pragma = "no-cache"
Expand Down

0 comments on commit cf07a41

Please sign in to comment.