Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target_uri of annotations is not correct if PDF URL redirects #480

Open
robertknight opened this issue May 5, 2021 · 0 comments
Open

target_uri of annotations is not correct if PDF URL redirects #480

robertknight opened this issue May 5, 2021 · 0 comments

Comments

@robertknight
Copy link
Member

When annotating PDFs in Via, the URL that is recorded with the annotation (ie. its target_uri property in the h backend) reflects the URL that was initially passed to Via, not the actual URL that the PDF was fetched from after following any redirects. This means that users annotating the same PDF via different links which all redirect to the same location can end up creating annotations associated with different URLs. This issue also means that the URL associated with a document can be different for one user who annotates it through Via and another user who annotates via the Chrome extension.

From a practical point of view this tends not to matter because the PDF fingerprint will be the same in both cases, any links to the document from activity pages etc. will still work as long as the site owner has the redirect in place.

While it is generally true that we would want the annotation's URL to reflect the final URL, there are some cases where we might not want to do that. For example, if a stable URL redirects to a temporary URL. This can happen with Google Drive PDF download URLs (used in the LMS app) for example (https://drive.google.com/uc?id={id}&export=download is a stable URL that redirects to a temporary signed URL like https://doc-0s-90-docs.googleusercontent.com/docs/securesc/{long_signature}).


Steps to reproduce:

  1. Go to https://via.hypothes.is and enter a PDF URL which redirects. For example https://arxiv.org/pdf/2105.01649 will redirect to https://arxiv.org/pdf/2105.01649.pdf
  2. Create an annotation on that URL
  3. Check the URL associated with the annotation (you can get this by clicking the timestamp and copying the document URL from the annotation's page)

Expected result:

The annotation's URL should reflect the final location that the PDF was fetched from, after following redirects.

Actual result:

The annotation's URL reflects the initial location that the PDF was requested from. eg. https://arxiv.org/pdf/2105.01649 rather than https://arxiv.org/pdf/2105.01649.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant