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

DefaultHttpLoader creates invalid accept header #191

Closed
aixigo-soffermann opened this issue Oct 1, 2021 · 2 comments · Fixed by #200 · May be fixed by aixigo-soffermann/titanium-json-ld#1
Closed

DefaultHttpLoader creates invalid accept header #191

aixigo-soffermann opened this issue Oct 1, 2021 · 2 comments · Fixed by #200 · May be fixed by aixigo-soffermann/titanium-json-ld#1
Labels
bug Something isn't working
Milestone

Comments

@aixigo-soffermann
Copy link

This line is broken. It should be

        builder.append(";q=0.9,*/*;q=0.1");

Otherwise https://www.w3.org/ns/activitystreams will always return "text/html" instead of "application/ld+json".

You can easily verify this using curl:

curl -i https://www.w3.org/ns/activitystreams -H "accept: application/ld+json;profile="http://www.w3.org/ns/json-ld#context",application/json;q=0.9,*/*;q=0.8"

returns:

HTTP/2 200 
date: Fri, 01 Oct 2021 12:43:05 GMT
content-location: activitystreams.html
vary: negotiate,accept,Accept-Encoding
tcn: choice
last-modified: Mon, 09 Nov 2020 11:09:17 GMT
etag: "9033-5b3aa97d9d140;d3-540ee27e0eec0"
accept-ranges: bytes
content-length: 36915
cache-control: max-age=21600
expires: Fri, 01 Oct 2021 18:43:05 GMT
access-control-allow-origin: *
content-type: text/html; charset=utf-8
x-backend: ssl-mirrors
strict-transport-security: max-age=15552000; includeSubdomains; preload
content-security-policy: upgrade-insecure-requests

...

Whereas

curl -i https://www.w3.org/ns/activitystreams -H "accept: application/ld+json;profile="http://www.w3.org/ns/json-ld#context",application/json;q=0.9,*/*;q=0.1"

returns

HTTP/2 200 
date: Fri, 01 Oct 2021 12:45:42 GMT
content-location: activitystreams.jsonld
vary: negotiate,accept
tcn: choice
last-modified: Mon, 09 Nov 2020 11:09:17 GMT
etag: "1f31-5b3aa97d9d140;d3-540ee27e0eec0"
accept-ranges: bytes
content-length: 7985
cache-control: max-age=21600
expires: Fri, 01 Oct 2021 18:45:42 GMT
access-control-allow-origin: *
content-type: application/ld+json
x-backend: ssl-mirrors
strict-transport-security: max-age=15552000; includeSubdomains; preload
content-security-policy: upgrade-insecure-requests

...
@filip26
Copy link
Owner

filip26 commented Oct 1, 2021

Hi @aixigo-soffermann
thank you for reporting that Please feel free to open PR.

@filip26 filip26 added the bug Something isn't working label Oct 1, 2021
@github-actions
Copy link

github-actions bot commented Nov 1, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment!

@github-actions github-actions bot added the Stale label Nov 1, 2021
filip26 added a commit that referenced this issue Dec 12, 2021
@filip26 filip26 removed the Stale label Dec 12, 2021
@filip26 filip26 linked a pull request Dec 12, 2021 that will close this issue
@filip26 filip26 added this to the 1.2.0 milestone Dec 12, 2021
filip26 added a commit that referenced this issue Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants