Skip to content

Fix subdomain mode and content negotiation issues #19

Description

@melvincarvalho

Summary

Several issues were discovered when testing subdomain mode with solid.social:

  1. Container content negotiation - Container listings always returned JSON-LD even when Accept: text/turtle was requested, causing mashlib parse errors
  2. Subdomain URL generation - Pod creation and registration generated path-based URLs instead of subdomain-based URLs when subdomain mode was enabled
  3. CORS DPoP header - The DPoP header was not in the allowed CORS headers list, breaking Solid-OIDC authentication
  4. .ttl extension handling - Files with .ttl extension were not served as Turtle format

Reproduction

  1. Enable subdomain mode in config
  2. Create a new account
  3. Visit the pod root (e.g., https://alice.example.com/)
  4. Mashlib fails with parse errors because container listings return JSON-LD when Turtle is requested

Fix

  • Add content negotiation support for container listings without index.html
  • Pass correct podUri and issuer to createPodStructure in subdomain mode
  • Add DPoP to Access-Control-Allow-Headers
  • Check URL extension for .ttl files and serve Turtle regardless of Accept header

Files Changed

  • src/handlers/resource.js - Container conneg and .ttl extension handling
  • src/handlers/container.js - Pass podUri/issuer correctly
  • src/idp/interactions.js - Build subdomain URLs during registration
  • src/ldp/headers.js - Add DPoP to CORS headers

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