Introduction
host-meta is a document that holds metadata about a whole host. RFC 6415 (Web Host Metadata) says a client gets it by sending HTTP or HTTPS GET to /.well-known/host-meta, on the default ports. A host must serve at least one of the two protocols
and, if both, “they MUST produce the same document”. The document “SHOULD be served with the application/xrd+xml media type”. A 301, 302 or 307 answer is to be followed; a 404 or 410 means no metadata is available. The XML form is required; the JSON Resource Descriptor form, at
/.well-known/host-meta.json, is recommended, and a server that does not serve it must answer 404.
Structure
<?xml version='1.0' encoding='UTF-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
<Link rel='lrdd' type='application/xrd+xml' template='https://example.com/lrdd?uri={uri}' />
<Link rel='copyright' href='http://example.com/copyright' />
</XRD>
| Part | Rule (RFC 6415) |
|---|---|
| root | “MUST be an XRD element”, from XRD 1.0 (OASIS). Other XRD elements are allowed unless the RFC excludes them. |
Subject | “SHOULD NOT” be included: no URI identifies a host (3.1). |
Alias | Its use in host-meta is undefined and not recommended (3.1). |
Link with href | A relation between the host and a target URI, such as <Link rel='copyright' href='…'/>. It is host-wide (3.1.1). |
Link with template | A relation whose context is an individual resource on the host; the target is the template with the resource’s URI substituted. The template syntax is a string with brace-enclosed variables; the one defined variable is {uri} (the entire context URI); a variable
name is uri or letters, digits, “.” and “_”. Values are UTF-8 encoded and percent-encoded for everything but unreserved characters. A client that cannot process a template SHOULD ignore the link (3.1.1.1). |
rel="lrdd" | The link-based resource descriptor discovery relation: its target is a document about one resource; a client reads it one level deep (4.2). |
| host-meta.json | The same information as a JRD: subject, expires, aliases, properties, and links with rel, type, href, template, titles, properties (Appendix A). |
In the explorer
Two plugins read the two forms. A file named host-meta, or any .xml file whose root is XRD in the XRD 1.0 namespace, opens as XML with a Links tab and the problems; a file named host-meta.json that is a JSON object whose links each have a rel and an
href or template opens as JSON with the same. A problem is a rule above: a Subject, an Alias, a Link without rel, with both or neither of href and template, a template with a bad variable name or unbalanced braces. Other files with these names open as before (a bare
host-meta as an unknown file, host-meta.json as JSON). Of the public Fediverse sites tried, 8 served a host-meta XRD and 2 a host-meta.json; the others answered an HTML page or nothing.
Not described
Known, not yet covered
- Reference: the XRD 1.0 specification itself (OASIS) was not read: the elements
Expires,TitleandProperty, thexsi:nilrule and the attributes ofLinkother than those RFC 6415 uses are named by the RFC only. - Reference: the processing of resource-specific information (RFC 6415 section 4.2) and the security considerations (section 5) are summarised, not described.
- Viewer: templates are checked for syntax, not applied to a resource; nothing is fetched, so LRDD documents are not followed.
Unknown
- Reference: whether
relis required on every XRDLink: all the RFC’s examples carry it, and the XRD text was not read.
Links
Reference
- RFC 6415 – Web Host Metadata
- Extensible Resource Descriptor (XRD) Version 1.0 – OASIS
- WebFinger response – the JSON descriptor for one resource