Adding metadata to topic Link header as a target attribute
leipert opened this issue · comments
Would it be okay, to add custom metadata to the Link headers as target attributes?
For example during discovery:
Link: <http://example.org>; rel="self"; title="example",
<http://example.org/hub>; rel="hub"; title="example hub"
We are trying to solve the problem, that our publishers have only the possibility to compare IRIs by Simple String Comparison [1], so the the topic urls http://über.com
and http://%C3%BCber.com
would be two different for them.
But according to that according to [RFC5988], Section 5.1 the topic IRI http://über.com
needs to be transcribed as http://%C3%BCber.com
in the Link Header (e.g. Link: <http://%C3%BCber.com>; rel="self")
.
The subscriber cannot differentiate between the escaped and the unescaped topics.
We would like to extend the topic link header with the target attribute (encoded="false"), so that:
http://über.com
maps to:Link: <http://%C3%BCber.com>; rel="self"; encoded="true"
orLink: <http://%C3%BCber.com>; rel="self"
Example Subscription Request:POST /hub HTTP/1.1 Content-Type: application/x-www-form-urlencoded; charset=utf-8 Host: example.org Connection: close Content-Length: 118 hub.callback=http%3A%2F%2Fexample.org%2Fsubscriber%2Fcb%2F1234&hub.mode=subscribe&hub.topic=http%3A%2F%2F%C3%BCber.com
http://%C3%BCber.com
maps to:Link: <http://%C3%BCber.com>; rel="self"; encoded="false"
Example Subscription Request:POST /hub HTTP/1.1 Content-Type: application/x-www-form-urlencoded; charset=utf-8 Host: example.org Connection: close Content-Length: 122 hub.callback=http%3A%2F%2Fexample.org%2Fsubscriber%2Fcb%2F1234&hub.mode=subscribe&hub.topic=http%3A%2F%2F%25C3%25BCber.com
Do you think this is a valid solution to our problem? If you want, I can go into details why our publishers compare IRIs only by Simple String Comparison.
/cc @depressiveRobot
[^1]: [[RFC 3987], 5.3.1. Simple String Comparison]1
Footnotes
Edit: I just realized, that
http://über.com
would be decoded as:
Link: <http://%C3%BCber.com>; rel="self"
and http://%C3%BCber.com
as:
Link: <http://%25C3%25BCber.com>; rel="self"
So my question above is kind of unnecessary.
I am closing this issue and opening #80 for the question of the target attributes.