Skip to content

Commit ba7ed56

Browse files
author
Awais Hussain
committed
Bugfix: Empty headers should default to empty dict
Since we are now merging the headers specified in the transport with the headers specified on a per request basis, we need to make sure the old headers are of type `dict`, a `None` is not sufficient.
1 parent 33a65e7 commit ba7ed56

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

gql/exceptions.py

Whitespace-only changes.

gql/transport/requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def execute(self, document, variable_values=None, timeout=None, headers={}):
2727
'variables': variable_values or {}
2828
}
2929

30-
merged_headers = self.headers.copy()
30+
merged_headers = self.headers.copy() if self.headers else {}
3131
merged_headers.update(headers)
3232

3333
data_key = 'json' if self.use_json else 'data'

0 commit comments

Comments
 (0)