Title: Conneg: .meta and .acl files are not recognized as RDF, break Turtle-native clients · Issue #294 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Conneg: .meta and .acl files are not recognized as RDF, break Turtle-native clients · Issue #294 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Conneg: .meta and .acl files are not recognized as RDF, break Turtle-native clients · Issue #294 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Symptom A Turtle-native Solid client (e.g. umai) fetching `//.meta` from a JSS pod (conneg enabled) gets JSON-LD back instead of Turtle, and errors with `MalformedSolidDocumentError: Malformed Turtle document ... Expected entity but got ...
Open Graph Description: Symptom A Turtle-native Solid client (e.g. umai) fetching `//.meta` from a JSS pod (conneg enabled) gets JSON-LD back instead of Turtle, and errors with `MalformedSolidDocumentError: Malformed Turt...
X Description: Symptom A Turtle-native Solid client (e.g. umai) fetching `//.meta` from a JSS pod (conneg enabled) gets JSON-LD back instead of Turtle, and errors with `MalformedSolidDocumentError: Malformed Turt...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/294
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Conneg: .meta and .acl files are not recognized as RDF, break Turtle-native clients","articleBody":"## Symptom\n\nA Turtle-native Solid client (e.g. [umai](https://github.com/noeldemartin/umai)) fetching \\`\u003cpod>/\u003ccontainer>/.meta\\` from a JSS pod (conneg enabled) gets JSON-LD back instead of Turtle, and errors with \\`MalformedSolidDocumentError: Malformed Turtle document ... Expected entity but got { on line 2\\`.\n\nReproduced today against ewingson's \\`test.solidweb.app\\` (JSS 0.0.144, \\`conneg: true\\`).\n\n## Root cause\n\n\\`getContentType(filePath)\\` in \\`src/utils/url.js:216\\` maps extensions to MIME types. The map is extension-based and has no entry for \\`.meta\\` or \\`.acl\\`:\n\n\\`\\`\\`js\nconst types = {\n '.jsonld': 'application/ld+json',\n '.json': 'application/json',\n '.ttl': 'text/turtle',\n // ... no '.meta' or '.acl'\n};\nreturn types[ext] || 'application/octet-stream';\n\\`\\`\\`\n\n\\`path.extname('/a/.meta')\\` returns \\`''\\` (leading-dot files have no extension per node:path), so the fallback hits. \\`.meta\\` and \\`.acl\\` both end up tagged \\`application/octet-stream\\`.\n\nDownstream: \\`handleGet\\`'s conneg branch is gated on \\`isRdfContentType(storedContentType)\\` (\\`src/handlers/resource.js:411\\`). \\`application/octet-stream\\` isn't an RDF type, so conneg never kicks in for these files — they're served verbatim as stored, regardless of \\`Accept\\`.\n\n## Mirror bug in .acl\n\nSame issue applies to \\`.acl\\`. It hasn't shown up visibly because:\n\n1. JSS's own \\`parseAcl()\\` (\\`src/wac/parser.js:38-49\\`) is forgiving — tries JSON first, falls back to Turtle. So server-side WAC checks work on either format.\n2. Most clients don't GET \\`.acl\\` via HTTP — they read \\`wac-allow\\` on the protected resource. Only ACL-editing tools fetch \\`.acl\\`, and the few that do mostly accept JSON-LD.\n\nBut the latent bug is real: JSS writes \\`.acl\\` as JSON-LD via \\`serializeAcl()\\` → \\`JSON.stringify()\\`. A strict-Turtle ACL editor pointed at any existing JSS pod today would hit the exact same parser error.\n\n## Fix\n\nTwo-line change to \\`getContentType\\`:\n\n\\`\\`\\`diff\n const types = {\n '.jsonld': 'application/ld+json',\n '.json': 'application/json',\n ...\n+ '.meta': 'application/ld+json', // Solid container metadata\n+ '.acl': 'application/ld+json', // WAC access control\n };\n\\`\\`\\`\n\nWe tag them as \\`application/ld+json\\` (not \\`text/turtle\\`) because:\n\n1. JSS's stance is JSON-LD native (see #282 / #283). That's the format we actually write these files in (\\`serializeAcl()\\`, \\`createPodStructure()\\`).\n2. Conneg handles the translation for Turtle-native clients automatically — \\`handleGet\\` already has a working \\`fromJsonLd(jsonLd, 'text/turtle', ...)\\` path for JSON-LD-stored files.\n3. The PUT side already handles the inverse: \\`handlePut:639\\` converts \\`text/turtle\\` bodies to JSON-LD before storing when \\`--conneg\\` is enabled.\n\nSo the round-trip lands for both client families with no further code change:\n\n| Client request | Today | After fix |\n|---|---|---|\n| umai: \\`PUT text/turtle .meta\\` | Stored as Turtle bytes (silent) | Converted to JSON-LD, stored |\n| umai: \\`GET .meta Accept: text/turtle\\` | Gets JSON-LD, parser errors | Gets Turtle, parser happy |\n| pilot: \\`GET .meta Accept: application/ld+json\\` | Served raw (happens to be JSON-LD) | Served raw (explicit) |\n\n## Back-compat\n\nExisting pods have JSON-LD \\`.acl\\` files on disk (written by \\`createPodStructure\\` via \\`serializeAcl\\`). Zero migration: the fix recognises them, conneg reads them correctly, Turtle clients start working immediately.\n\n## Scope\n\nTwo lines. Tests around \\`conneg.test.js\\` / \\`ldp.test.js\\` can add a case per file type (PUT Turtle, GET Turtle, both succeed; PUT JSON-LD, GET Turtle, convert) — straightforward to bolt onto existing fixtures.\n\nHappy to PR.","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-04-22T11:09:30Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/294"}
| 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:1695b51c-667a-aab7-4be8-f0628a61cbf5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B3E0:1E05DF:109E057:162FE0D:6B03CBF3 |
| html-safe-nonce | 38a43ba7309d269dda4e112037cac48f1b76c74ac59b064bc9142a8d3466925e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0UwOjFFMDVERjoxMDlFMDU3OjE2MkZFMEQ6NkIwM0NCRjMiLCJ2aXNpdG9yX2lkIjoiMzYwNDg4OTU1NTExMjgwNzQxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b14dc47cebb225ad46a0727a5469fbf9c9b75a24b0e95b547b2125bcd8ba1c4d |
| hovercard-subject-tag | issue:4308548225 |
| 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/294/issue_layout |
| twitter:image | https://opengraph.githubassets.com/11348213faedba6893fdf52fd64d95bb51093e1a957da9b52d01eaed9105091b/JavaScriptSolidServer/JavaScriptSolidServer/issues/294 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/11348213faedba6893fdf52fd64d95bb51093e1a957da9b52d01eaed9105091b/JavaScriptSolidServer/JavaScriptSolidServer/issues/294 |
| og:image:alt | Symptom A Turtle-native Solid client (e.g. umai) fetching `//.meta` from a JSS pod (conneg enabled) gets JSON-LD back instead of Turtle, and errors with `MalformedSolidDocumentError: Malformed Turt... |
| 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