Skip to content

--mashlib should auto-enable --conneg #22

Description

@melvincarvalho

Problem

When using --mashlib or --mashlib-cdn, .ttl files (like Settings/Preferences.ttl) are stored internally as JSON-LD but mashlib expects them to be served as Turtle format.

Without explicitly adding --conneg, the raw JSON-LD is served with a .ttl extension, causing mashlib to fail with parse errors:

Strange: Error parse_error trying to read your preference file.
Fetcher: Error trying to parse <http://localhost:3000/melvin/Settings/Preferences.ttl> as Notation3:
SyntaxError: Line 5: Bad syntax: expected '.' or '}' or ']' at end of statement

Expected behavior

When --mashlib or --mashlib-cdn is enabled, content negotiation should be automatically enabled so .ttl files are converted from JSON-LD to Turtle on the fly.

Proposed fix

In src/config.js or bin/jss.js, automatically set conneg: true when mashlib is enabled:

if (config.mashlib || config.mashlibCdn) {
  config.conneg = true;
}

Workaround

Explicitly add --conneg when starting the server:

jss start --mashlib-cdn --idp --conneg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions