{"type":"rich","version":"1.0","provider_name":"phorkie","provider_url":"https:\/\/p.cweiske.de\/","title":"Added WebFinger support to my email address using one rewrite rule and one static file.","author_name":"Christian Weiske","cache_age":86400,"width":900,"height":900,"html":"<!-- embedding all files of https:\/\/p.cweiske.de\/130 -->\n<link rel=\"stylesheet\" href=\"https:\/\/p.cweiske.de\/css\/embed.css\"\/>\n<div class=\"phork\" id=\"130\">\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  <div class=\"code\"><pre class=\"txt\">&lt;Directory \/var\/www\/profile&gt;\r\n    DefaultType application\/json\r\n    Header set Access-Control-Allow-Origin: &quot;*&quot;\r\n&lt;\/Directory&gt;\r\n\r\nRewriteEngine on\r\nRewriteMap unescape int:unescape\r\nRewriteCond ${unescape:%{QUERY_STRING}} resource=acct:(.+)\r\nRewriteRule ^\/.well-known\/webfinger \/profile\/${unescape:%1}? [last]<\/pre><\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/130\/rev-raw\/97dd233c54c75e8da454a33b71e1bc231ec483ab\/famarier.txt\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/130#famarier.txt\">famarier.txt<\/a>\n <\/div>\n<\/div>\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  <div class=\"code\"><pre class=\"txt\">Actually there are three problems with this:\r\n* URL-encoded query parameters are not unescaped prior to the mod_rewrite match\r\n* the content-type is not set\r\n* CORS headers are missing\r\n\r\nHere's my version:\r\nThis passes all of the checks on http:\/\/webfinger.net\/<\/pre><\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/130\/rev-raw\/97dd233c54c75e8da454a33b71e1bc231ec483ab\/fmarier-comments.txt\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/130#fmarier-comments.txt\">fmarier-comments.txt<\/a>\n <\/div>\n<\/div>\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  <div class=\"code\"><pre class=\"txt\">[aaron@parecki.com www]$ cat .htaccess \r\nRewriteEngine on\r\nRewriteCond %{QUERY_STRING} resource=acct:(.+)\r\nRewriteRule ^\\.well-known\/webfinger \/profile\/%1? [L]\r\n\r\n[aaron@parecki.com www]$ cat profile\/aaron@parecki.com\r\n{\r\n  &quot;subject&quot;: &quot;acct:aaron@parecki.com&quot;,\r\n  &quot;links&quot;: [\r\n    {\r\n      &quot;rel&quot;: &quot;http:\/\/webfinger.net\/rel\/avatar&quot;,\r\n      &quot;href&quot;: &quot;http:\/\/aaronparecki.com\/images\/aaronpk.png&quot;\r\n    },\r\n    {\r\n      &quot;rel&quot;: &quot;http:\/\/webfinger.net\/rel\/profile-page&quot;,\r\n      &quot;href&quot;: &quot;http:\/\/aaronparecki.com\/&quot;\r\n    },\r\n    {\r\n      &quot;rel&quot;: &quot;me&quot;,\r\n      &quot;href&quot;: &quot;http:\/\/aaronparecki.com\/&quot;\r\n    }\r\n  ]\r\n}\r\n\r\n<\/pre><\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/130\/rev-raw\/97dd233c54c75e8da454a33b71e1bc231ec483ab\/gistfile1.txt\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/130#gistfile1.txt\">gistfile1.txt<\/a>\n <\/div>\n<\/div>\n<\/div>\n"}
