Title: Authenticated GET on a container returns Turtle body with application/ld+json content-type, ignoring Accept · Issue #325 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Authenticated GET on a container returns Turtle body with application/ld+json content-type, ignoring Accept · Issue #325 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Authenticated GET on a container returns Turtle body with application/ld+json content-type, ignoring Accept · Issue #325 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary With --conneg enabled, an authenticated GET on a container returns a Turtle body but labels the response Content-Type: application/ld+json, regardless of the requested Accept. The same request without auth correctly returns JSON-...
Open Graph Description: Summary With --conneg enabled, an authenticated GET on a container returns a Turtle body but labels the response Content-Type: application/ld+json, regardless of the requested Accept. The same requ...
X Description: Summary With --conneg enabled, an authenticated GET on a container returns a Turtle body but labels the response Content-Type: application/ld+json, regardless of the requested Accept. The same requ...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/325
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Authenticated GET on a container returns Turtle body with application/ld+json content-type, ignoring Accept","articleBody":"## Summary\n\nWith `--conneg` enabled, an authenticated GET on a container returns a **Turtle body** but labels the response **`Content-Type: application/ld+json`**, regardless of the requested Accept. The same request without auth correctly returns JSON-LD. This breaks any client that trusts either the Accept negotiation or the Content-Type header (which is most of them).\n\n## Repro\n\nServer:\n```\nJSS_SINGLE_USER_PASSWORD=hunter2 jss start --port 4443 --root ~/main --single-user --idp --conneg\n```\n\nGet a token:\n```\nTOKEN=$(curl -s -X POST http://localhost:4443/idp/credentials \\\n -H \"Content-Type: application/json\" \\\n -d '{\"username\":\"me\",\"password\":\"hunter2\"}' | jq -r .access_token)\n```\n\n### Without auth — JSON-LD body, JSON-LD content-type ✓\n\n```\n$ curl -sI -H \"Accept: application/ld+json, text/turtle;q=0.5\" http://localhost:4443/me/profile/card.jsonld | grep -i content-type\ncontent-type: application/ld+json; charset=utf-8\n\n$ curl -s -H \"Accept: application/ld+json, text/turtle;q=0.5\" http://localhost:4443/me/ | head -3\n{\n \"@context\": {\n \"ldp\": \"http://www.w3.org/ns/ldp#\",\n```\n\n### With auth — Turtle body, **JSON-LD content-type** ✗\n\n```\n$ curl -sI -H \"Authorization: Bearer $TOKEN\" -H \"Accept: application/ld+json, text/turtle;q=0.5\" http://localhost:4443/me/ | grep -i content-type\ncontent-type: application/ld+json\n\n$ curl -s -H \"Authorization: Bearer $TOKEN\" -H \"Accept: application/ld+json, text/turtle;q=0.5\" http://localhost:4443/me/ | head -3\n@prefix rdf: \u003chttp://www.w3.org/1999/02/22-rdf-syntax-ns#>.\n@prefix rdfs: \u003chttp://www.w3.org/2000/01/rdf-schema#>.\n@prefix xsd: \u003chttp://www.w3.org/2001/XMLSchema#>.\n```\n\nThe body is plainly Turtle, the header says JSON-LD. Even when I request `Accept: application/ld+json` explicitly (no Turtle in the Accept at all), the auth path still serves Turtle.\n\n## Expected\n\nEither:\n- **Body matches Accept** — auth path honors the same q-weighted negotiation as the anonymous path. Default to JSON-LD (the documented native format) when client prefers it.\n- **Header matches body** — at minimum, the Content-Type label should reflect what's actually in the body.\n\nProbably both. JSON-LD is JSS's native format; Turtle should only come back when the client asks for it.\n\n## Why it matters\n\nClients that do `if (contentType.includes('json')) JSON.parse(body)` get a parse error on perfectly conformant requests. The mislabel is the worst part — a sniff (e.g. \\\"first non-whitespace char is `{` or `@`\\\") can route around it, but every consumer shouldn't have to.\n\n## Environment\n\n- jss `0.0.155` (latest published)\n- node `v24.5.0`\n- Linux x86_64\n\nLikely a divergence between two response paths inside the auth middleware vs. the anonymous handler. Happy to look at the conneg layer if you want a PR.","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-04-27T06:17:29Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/325"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:68e9b9fa-b285-bd09-72a6-94aef4ee8194 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A03E:34BD38:660299:818BEA:6B0393A9 |
| html-safe-nonce | 1a47caf9bc9438b35877e9da1947426c20e970aac80b2888a7502c61cb8521b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDNFOjM0QkQzODo2NjAyOTk6ODE4QkVBOjZCMDM5M0E5IiwidmlzaXRvcl9pZCI6Ijc3OTUzNzgyNDQ0NDgxNDI0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4e6fb1c2814cd5b361b4d93b6a4175ff0fdf8f64350ca062088eb7ad4e422ae5 |
| hovercard-subject-tag | issue:4333490834 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/325/issue_layout |
| twitter:image | https://opengraph.githubassets.com/550898cac7d98bb7d4e81567b38ffb99372b4787f77f7eb76644c606050513ab/JavaScriptSolidServer/JavaScriptSolidServer/issues/325 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/550898cac7d98bb7d4e81567b38ffb99372b4787f77f7eb76644c606050513ab/JavaScriptSolidServer/JavaScriptSolidServer/issues/325 |
| og:image:alt | Summary With --conneg enabled, an authenticated GET on a container returns a Turtle body but labels the response Content-Type: application/ld+json, regardless of the requested Accept. The same requ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width