FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

plugin api: api.headers.link() — plugins add Link relations to every LDP response · Issue #625 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub

plugin api: api.headers.link() — plugins add Link relations to every LDP response #625

Open

Description

Plugin seam for #621 (LWS), under #206.

Problem

LWS requires Link: <storage>; rel="https://www.w3.org/ns/lws#storage" on every response from the storage, plus up, type and linkset relations on resources. Plugins get a scoped Fastify instance (api.fastify), so an onSend hook registered there only fires under the plugin's prefix — never on /alice/foo.

Discovery links are the canonical "a plugin wants to be visible from pod resources" need (ActivityPub rel="alternate" to an actor, Nostr rel="nostr", remoteStorage rel="remotestorage" would all use it), so this is worth a general seam rather than LWS-specific code.

Proposal

api.headers.link((request, { url, isContainer, isRoot, pod }) => {
  // return an array of { href, rel, attrs? } or nothing
  return [{ href: pod.storageUrl, rel: 'https://www.w3.org/ns/lws#storage' }];
});

Prior art: LwsLinkMetadataWriter in jeswr/LinkedWebStorage.

Activity

  1. added
    enhancementNew feature or request
    pluginCould be implemented as a plugin (#206); core/plugin line defined in #564
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpluginCould be implemented as a plugin (#206); core/plugin line defined in #564

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL