Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Redirect user to original URL instead of proxy if annotation was created by a third-party user #61
Depends on #60, will need rebasing.
If a direct-linked annotation was made on a page that embeds Hypothesis and uses third party accounts then the page is highly likely to be broken if delivered through the Via proxy service since Via does not allow cookies to be read/written amongst other issues. Since we know the page already embeds Hypothesis we can just redirect the user to the original URL in this case.
Whether or not an annotation is "third party" is determined by comparing the "authority" field of the Elasticsearch document with a
@@ Coverage Diff @@ ## master #61 +/- ## ========================================== + Coverage 88.44% 88.73% +0.28% ========================================== Files 10 10 Lines 554 568 +14 ========================================== + Hits 490 504 +14 Misses 64 64
I’m having a hard time picking through the history here, trying to figure out which commits are prerequisites for the main change and which are things you spotted along the way. Could you please split the things that can be split into separate pull requests? Anything that would reduce the amount of code that needs digesting at once would be helpful, especially given this is a fairly complicated change that spans multiple programming languages.
Hmm... I've restructured the commits and added more details to the commit messages to try to make things clearer. The first three commits are setup to enable the change and then the last commit actually implements the change. Splitting it out into separate PRs would be awkward at this point because the documentation added in the second commit is altered by the change in the last commit, and splitting out the one-line change in the first commit seems a bit much to me.
This mostly looks fine to me. I’ve got a couple of questions and what look like some minor mistakes. The main question I’ve got is about how you settled on the approach you’ve gone with, out of the two options we had available.