pubsubhubbub / PubSubHubbub

The PubSubHubbub protocol specification.
http://pubsubhubbub.github.io/PubSubHubbub
602 stars 122 forks source link

Use Link: HTTP header for discovery #2

Closed evanp closed 12 years ago

evanp commented 12 years ago

In discovery, we've added "X-Hub-Url" and "X-Hub-Self-Url".

Let's use the nice standard Link: header from RFC 5988 instead. See http://tools.ietf.org/html/rfc5988 and http://www.w3.org/wiki/LinkHeader .

So:

Link: <http://example.com/hub>; rel=hub

and:

Link: <http://example.com/avatar.jpg>; rel=self
evanp commented 12 years ago

Note that we keep the analogy to 0.3 discovery.

superfeedr commented 12 years ago

Yeah, I hesistated. We had trouble with one customer with this. He found that complex and wondered why not use a simple header with a Key: Value where the Value was the whole thing. It's the same for me, but I see how extracting the stuff may be a tiny bit more complex for non-http-spec aware people.

ralphm commented 12 years ago

As the discovery is done by the hub, the complexity here is on two parties: the hub implementer and the feed provider. The subscriber doesn't have to deal with this. I don't think the former is a problem at all, and the latter is a matter of good examples.

I support the idea of using the Link HTTP header instead of introducing new ones. It also frees this specification from talking about IRLs vs. URLs, various security aspects, etc.

Note that RFC 5988, which (re-)defines the Link HTTP header, also establishes the link-relations registry at IANA. This includes 'hub', and that in itself is a good reason to point to this RFC.

ralphm commented 12 years ago

Eh, oops, I'm not sure what I was thinking here. Of course the subscriber needs to implement this, but I don't really see this as a big issue. I can imagine auto-discovery libraries that take any link-relation and a URI and then perform different discovery steps as desired in a generic fashion. First trying HTTP Link headers, then optionally looking for embedded link elements in HTML or Atom. It could even try XRD Link Rel.

superfeedr commented 12 years ago

Raphlm,

I am sorry, but discovery is certainly not done by the hub, but by the subscriber (that's the whole point of PubSubHubbub being decentralized). The subscriber does have to deal with this.

The flow is :

But I'm ok with the use of Link headers.

superfeedr commented 12 years ago

Bam. Cross comments :)

julien51 commented 12 years ago

Fixed in #7ac2e59 and closing now :)

evanp commented 12 years ago

I'm looking here:

http://code.google.com/p/pubsubhubbub/wiki/ArbitraryContentTypes

Very interesting!

evanp commented 12 years ago

rel=hub and rel=self are already defined in RFC 5988: http://tools.ietf.org/html/rfc5988

ralphm commented 12 years ago

Indeed, see above :-)