indieweb / indieauth

IndieAuth.net website code and IndieAuth Specification
52 stars 7 forks source link

Discovery should clarify priority #9

Closed sknebel closed 6 years ago

sknebel commented 6 years ago

The discovery section https://indieauth.net/spec/#discovery should be very clear about what to do if multiple links for the same endpoint are encountered (either "prefer link headers to tags, and pick the first of multiple ones", or even "abort if multiple different ones are encountered")

aaronpk commented 6 years ago

Great point. What do most people do right now?

The PHP client I wrote will use the HTTP header if it's found before parsing the HTML body.

Zegnat commented 6 years ago

It makes sense to prioritise HTTP headers because:

Clients MAY initially make an HTTP HEAD request [RFC7231] to follow redirects and check for the Link header before making a GET request.

If a client finds a usable Link header in the HEAD request, it makes sense if they are allowed to skip the GET request completely. If you then wish to ensure different clients come to the same conclusion, a client that only does GET requests must prioritise the Link headers.

This would also match the PHP client, which skips the GET request if the HEAD discovered the endpoint.