fix: Rewrite getPodBase to always get correct podBase #17
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.
The new algorithm uses a combination of looking at the response headers to see if the current resource is the podBase, as defined by
Clients can determine the storage of a resource by moving up the URI path hierarchy until the response includes a Link header with rel="type" targeting http://www.w3.org/ns/pim/space#Storage.
, and at the same time also looking if there is a pim:Storage (as object) triple in the resource stating that this resource is the podBase; as some server implementations use this technique. Lastly, it also checks if there is a pim:storage (as predicate) triple in the resource, defining where the podBase is stored, used e.g. in the WebID resource on ESS.This now works on ESS 2.0 (where the WebID is on the id.inrupt.com domain and the storage root is on the storage.inrupt.com domain), CSS with the POD as root (lik mypod.com/profile/card#me) as CSS with multiple accounts (like mypod.com/myuser/profile/card#me)