-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avoid duplicate "header" kwarg #144
Conversation
Fixes digitalbazaar#133 If headers were passed during call to `requests_document_loader`, these headers will be forced in call to `requests.get`.
headers = { | ||
'Accept': 'application/ld+json, application/json' | ||
} | ||
response = requests.get(url, headers=headers, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unclear how this PR is changing the behavior. From what I am seeing, even before the PR a user could do
requests_document_loader(…, headers={
'Foo': 'bar',
})
it should be working on implementation at master
. Or am I misunderstanding it?
|
||
headers = {} if 'headers' in kwargs else ({ | ||
'headers': ( | ||
options.get('headers', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we're addressing both kwargs['headers']
and options['headers']
, where should those be found?
@@ -14,6 +14,9 @@ | |||
|
|||
from pyld.jsonld import (JsonLdError, parse_link_header, LINK_HEADER_REL) | |||
|
|||
DEFAULT_HEADERS = { | |||
'Accept': 'application/ld+json, application/json' | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I appreciate factoring this out as a global constant.
Fixes #133
If headers were passed during call to
requests_document_loader
,these headers will be forced in call to
requests.get
.