Read links from Link header of a Solid resource - #165
Open
mrkvon wants to merge 2 commits into
Open
Conversation
mrkvon
force-pushed
the
feat/issue-59/link-headers-resource
branch
2 times, most recently
from
July 23, 2026 05:01
58d217e to
62d402b
Compare
jaxoncreed
reviewed
Jul 24, 2026
Solid Resource has method `async getLinkHeader(ignoreCache?: boolean)`. The successful linkHeader result exposes interface of https://www.npmjs.com/package/http-link-header which allows flexible access to the parsed links from the link header. e.g. `linkHeaderResult.linkHeader.get("rel", "acl")` By default, the parsed link header is stored and read from cache. Closes o-development#59
mrkvon
force-pushed
the
feat/issue-59/link-headers-resource
branch
from
July 25, 2026 20:31
62d402b to
c1aded8
Compare
- Add resource method getHeaders() to get response headers. - Add resource method getHeader(headerName) to get specific header. - Remove .js from imports. - Other fixes and typos.
Collaborator
Author
✅
Added methods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solid Resources now have method
async getLinkHeader(ignoreCache?: boolean).The successful linkHeader result exposes interface of https://www.npmjs.com/package/http-link-header which allows flexible access to the parsed links from the link header.
e.g.
linkHeaderResult.linkHeader.get("rel", "acl")By default, the parsed link header is stored and read from cache.The cache gets cleared when the resource is deleted.To consider: Clear resource's link header cache also when a resource is updated, or whenever it is fetched with an error?Update: we always make a fresh
HEADrequest. No cache involved.We also expose all other headers in raw form via
resource.getHeaders(): Promise<Headers>andresource.getHeader(headerName: string): Promise<string|null>Closes #59