Skip to content
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

load_document: Lower priority of HTML inputs #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/pyld/jsonld.py
Original file line number Diff line number Diff line change
Expand Up @@ -6568,10 +6568,10 @@ def load_document(url,
:return: True if the value is an absolute IRI, False if not.
"""
headers = {
'Accept': 'application/ld+json, application/json;q=0.5'
'Accept': 'application/ld+json, application/json;q=0.8'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We define headers['Accept'] here…

}
# FIXME: only if html5lib loaded?
headers['Accept'] = headers['Accept'] + ', text/html;q=0.8, application/xhtml+xml;q=0.8'
headers['Accept'] = headers['Accept'] + ', text/html;q=0.5, application/xhtml+xml;q=0.5'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…and we modify that value here.

  • Would it be possible to specify the final value right away?
  • Probably a comment explaining what the magic 0.5 means would also be helpful to future readers.


if requestProfile:
headers['Accept'] = ('application/ld+json;profile=%s, ' % requestProfile) + headers['Accept']
Expand Down