[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-11 Thread daniel
daniel added a comment.
Thiemo pointed out another complication: our canonical URIs are HTTP, not HTTPS. There is a redirect from the HTTP URL to the HTTPS URL.

The HTTP-HTTPs-redirect woould need to have the Access-Control headers set. We don't want to proxy the content here, because we want to client to receive the data over a secure connection. HTTP is really a deprecated interface.

Perhaps the suggested force-redirect parameter can fix this, too. We can just treat HTTP and HTTPS access to the /entity/ path the same, without a redirect from one to the other. In both cases, we rewrite or proxy, and set the force-redirect param. This way, the /entity/ path will always return a redirect (or error), and always with the correct Access-Control headers.TASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hoo, danielCc: thiemowmde, gerritbot, hoo, daniel, Aklapper, elf-pavlik, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-10 Thread daniel
daniel added a comment.

In T150290#2784012, @hoo wrote:
That would also solve us T119536 for free, as far as I can tell.


It's pretty much exactly what T119536 is proposing, so I'm not sure about "free", but yea :)TASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hoo, danielCc: thiemowmde, gerritbot, hoo, daniel, Aklapper, elf-pavlik, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-10 Thread elf-pavlik
elf-pavlik added a comment.
But that would be semantically dirty. As far as I understand, it's best practice to not serve data directly when resolving a concept URI, but to redir3ect to a document URL first.

I understood that it would work this way

URI of a thing: http://www.wikidata.org/entity/Q1141085
would HTTP 303 redirect to the document with the representation in requested content type
https://www.wikidata.org/wiki/Special:EntityData/Q1141085.ttl

Currently as explained in  T119536 you have two 303 redirects. If you proxy pass the URI of a thing (instead of the first 303 redirect) to Special:EntityData page which seems to handle content negotiation. It should still 303 redirect you (currently the second 303 redirect)  to the document with requested content type, so this case: https://www.w3.org/TR/cooluris/#r303uriTASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hoo, elf-pavlikCc: thiemowmde, gerritbot, hoo, daniel, Aklapper, elf-pavlik, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-10 Thread gerritbot
gerritbot added a comment.
Change 320691 merged by jenkins-bot:
Always set "Access-Control-Allow-Origin: *" in EntityDataRequestHandler

https://gerrit.wikimedia.org/r/320691TASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hoo, gerritbotCc: thiemowmde, gerritbot, hoo, daniel, Aklapper, elf-pavlik, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-10 Thread daniel
daniel added a comment.
A potential solution I could think of would be to ProxyPass the /entity/ (and related) redirects to the special page.

But that would be semantically dirty. As far as I understand, it's best practice to not serve data directly when resolving a concept URI, but to redir3ect to a document URL first. This manifests the distinction between document and subject URIs on the HTTP level, avoiding confusion.

What we could do is to handle all redirects from PHP, where we have control over the Access-Control headers, instead of triggering the redirects in Apache/Nginx/Varnish. The rewrite rules would have to be changed to rewrite (not redirect or proxy) to the URL of Special:EntityData with some special parameter set to trigger the redirect.TASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hoo, danielCc: thiemowmde, gerritbot, hoo, daniel, Aklapper, elf-pavlik, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-09 Thread elf-pavlik
elf-pavlik added a comment.
A potential solution I could think of would be to ProxyPass the /entity/ (and related) redirects to the special page. That would also solve us T119536 for free, as far as I can tell.

brilliant!

so we should get

curl -IL http://www.wikidata.org/entity/Q1141085 -H "Accept: text/turtle"

HTTP/1.1 303 See Other
Location: https://www.wikidata.org/wiki/Special:EntityData/Q1141085.ttl
Access-Control-Allow-Origin: *



HTTP/1.1 200 OK
Content-Type: text/turtle; charset=UTF-8
Access-Control-Allow-Origin: *TASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: elf-pavlikCc: gerritbot, hoo, daniel, Aklapper, elf-pavlik, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-09 Thread gerritbot
gerritbot added a comment.
Change 320691 had a related patch set uploaded (by Hoo man):
Always set "Access-Control-Allow-Origin: *" in EntityDataRequestHandler

https://gerrit.wikimedia.org/r/320691TASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: gerritbot, hoo, daniel, Aklapper, elf-pavlik, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-09 Thread elf-pavlik
elf-pavlik added a comment.
This issue looks also related to https://phabricator.wikimedia.org/T119536 which I understand proposes removing the second 303 which I +1

Where do you set CORS header for https://www.wikidata.org/wiki/Special:EntityData/Q1141085.ttl or https://www.wikidata.org/wiki/Special:EntityData/Q1141085.json ? Those responses have Access-Control-Allow-Origin: *TASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: elf-pavlikCc: hoo, daniel, Aklapper, elf-pavlik, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T150290: add CORS to all redirecs in chain from https://www.wikidata.org/entity/{Q...}

2016-11-09 Thread hoo
hoo added a comment.
These redirect headers are set via Apache configuration in modules/mediawiki/files/apache/sites/wikidata-uris.incl in https://gerrit.wikimedia.org/r/operations/puppet. I don't think Apache has a nice way to set additional headers in these cases (only).TASK DETAILhttps://phabricator.wikimedia.org/T150290EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hooCc: hoo, daniel, Aklapper, elf-pavlik, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs