Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Resolving Relative URLs #3

Open
dillonredding opened this issue Sep 22, 2021 · 0 comments
Open

Resolving Relative URLs #3

dillonredding opened this issue Sep 22, 2021 · 0 comments

Comments

@dillonredding
Copy link
Member

I'd like to clarify exactly how to resolve relative URLs in a Siren representation. I believe we can simply follow the rules from Section 5.2 of RFC 3986, which makes this more a problem of establishing a base URL. Here are my thoughts on the few spots to consider:

  • hrefs in the top-level links and actions
  • hrefs in sub-entities (including their links and actions)
    • Recursively check encapsulating entities' self links for an absolute href. If one exists, use that as the base URI. See Section 5.1.2 of RFC 3986.
    • Otherwise, the base URI is the one used to retrieve the top-level entity.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant