-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Memento links should be in same mode as Memento #111
Labels
bug
Something isn't working
Comments
Mr0grog
added a commit
that referenced
this issue
Feb 27, 2023
The `links` attribute on a Memento object links to other related resources, such as the first/previous/next/last memento of the URL. These are super useful for iterating and navigating through Mementos, BUT the archive.org servers always return these as links to the memento in "view" mode. Users of this library rarely use "view" mode, and if you are iterating through links in a different mode, simply following one of the links can lead to subtle mistakes! To mitigate the issue, this changes all the links that reference mementos to use the same mode as the Memento object they are attached to. Fixes #111.
Mr0grog
added a commit
that referenced
this issue
Feb 27, 2023
The `links` attribute on a Memento object links to other related resources, such as the first/previous/next/last memento of the URL. These are super useful for iterating and navigating through Mementos, BUT the archive.org servers always return these as links to the memento in "view" mode. Users of this library rarely use "view" mode, and if you are iterating through links in a different mode, simply following one of the links can lead to subtle mistakes! To mitigate the issue, this changes all the links that reference mementos to use the same mode as the Memento object they are attached to. Fixes #111.
Mr0grog
added a commit
that referenced
this issue
Mar 7, 2023
The `links` attribute on a Memento object links to other related resources, such as the first/previous/next/last memento of the current memento's URL. These are super useful for iterating and navigating through mementos, BUT the archive.org servers always return these as links to the memento in "view" mode. Users of this library rarely use "view" mode, and if you are iterating through links in a different mode, simply following one of the links can lead to subtle mistakes! To mitigate this, we now change all the links that reference mementos to use the same mode as the `Memento` object they are attached to. Fixes #111.
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #108, I added a
link
property toMemento
objects with parsed data from theLink
HTTP headers of mementos. However, the links to other mementos in that data turn out to always be inview
mode, regardless of the mode of the memento you requested!For example:
The suggested use for these links is to pass them directly to
get_memento()
, but that might get you a memento in a different mode than you expect! It’s a footgun.Some options here:
Drop the
links
attribute onMemento
for now. Users can parse theLink
header(s) themselves if they want it, and are responsible for using them appropriately. (In this case, we also need to reopen Add info about link header relationships toMemento
#57.)Update the
url
field on any link that references a memento to match the mode of theMemento
object they are attached to.Side note: how do we identify which things are mementos? Look for
"memento"
as a substring in therel
field? Look forurl
fields that match known memento URL patterns?Instead of the values in
links
being dictionaries, make them some more useful data object. References to other mementos might be more like ourCdxRecord
objects, where theurl
is the captured URL (e.g.http://www.epa.gov/
instead of the memento URL), the timestamp is adatetime
object, etc.I think (3) has too many open questions, but we should do (1) or (2) before cutting a 0.4.1 release.
The text was updated successfully, but these errors were encountered: