From: Christian Weiske Date: Wed, 23 Jul 2014 04:24:23 +0000 (+0200) Subject: (no commit message) X-Git-Url: https://git.cweiske.de/paste/130.git/commitdiff_plain/HEAD --- diff --git a/famarier.txt b/famarier.txt new file mode 100644 index 0000000..2f52bd3 --- /dev/null +++ b/famarier.txt @@ -0,0 +1,9 @@ + + DefaultType application/json + Header set Access-Control-Allow-Origin: "*" + + +RewriteEngine on +RewriteMap unescape int:unescape +RewriteCond ${unescape:%{QUERY_STRING}} resource=acct:(.+) +RewriteRule ^/.well-known/webfinger /profile/${unescape:%1}? [last] \ No newline at end of file diff --git a/fmarier-comments.txt b/fmarier-comments.txt new file mode 100644 index 0000000..7dccf75 --- /dev/null +++ b/fmarier-comments.txt @@ -0,0 +1,7 @@ +Actually there are three problems with this: +* URL-encoded query parameters are not unescaped prior to the mod_rewrite match +* the content-type is not set +* CORS headers are missing + +Here's my version: +This passes all of the checks on http://webfinger.net/ \ No newline at end of file diff --git a/gistfile1.txt b/gistfile1.txt index 63cacd8..cb65b56 100644 --- a/gistfile1.txt +++ b/gistfile1.txt @@ -1,24 +1,24 @@ -[aaron@parecki.com www]$ cat .htaccess -RewriteEngine on -RewriteCond %{QUERY_STRING} resource=acct:(.+) -RewriteRule ^\.well-known/webfinger /profile/%1? [L] - -[aaron@parecki.com www]$ cat profile/aaron@parecki.com -{ - "subject": "acct:aaron@parecki.com", - "links": [ - { - "rel": "http://webfinger.net/rel/avatar", - "href": "http://aaronparecki.com/images/aaronpk.png" - }, - { - "rel": "http://webfinger.net/rel/profile-page", - "href": "http://aaronparecki.com/" - }, - { - "rel": "me", - "href": "http://aaronparecki.com/" - } - ] -} - +[aaron@parecki.com www]$ cat .htaccess +RewriteEngine on +RewriteCond %{QUERY_STRING} resource=acct:(.+) +RewriteRule ^\.well-known/webfinger /profile/%1? [L] + +[aaron@parecki.com www]$ cat profile/aaron@parecki.com +{ + "subject": "acct:aaron@parecki.com", + "links": [ + { + "rel": "http://webfinger.net/rel/avatar", + "href": "http://aaronparecki.com/images/aaronpk.png" + }, + { + "rel": "http://webfinger.net/rel/profile-page", + "href": "http://aaronparecki.com/" + }, + { + "rel": "me", + "href": "http://aaronparecki.com/" + } + ] +} +