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

Initial Memento Prefer Header Support #12

Closed
ikreymer opened this issue Feb 21, 2018 · 1 comment
Closed

Initial Memento Prefer Header Support #12

ikreymer opened this issue Feb 21, 2018 · 1 comment

Comments

@ikreymer
Copy link
Contributor

Initial support based on the proposal explained in: mementoweb/rfc-extensions#6

@ikreymer ikreymer changed the title Initial Memento Prefer Header Initial Memento Prefer Header Support Feb 21, 2018
ikreymer added a commit to ukwa/pywb that referenced this issue Feb 28, 2018
…raw' or 'rewritten' mementos (ukwa/ukwa-pywb#12, based on mementoweb/rfc-extensions#6)

- 'enable_prefer: true' in config can be used to enable experimental Memento Prefer behavior
- Prefer header support both redirect and non-redirect style negotiation, extending existing Memento patterns
- Prefer header can be applied both on memento and timegate endpoints
- for redirect style negotiation, Prefer results in a redirect to final memento (if needed), both on Timegate and URL-M (Memento Pattern 2.3)
- for non-redirect style negotiation (Memento Pattern 2.2), Prefer header affects content being served and changes the Content-Location to the canonical representation
- Vary: Prefer and Preference-Applied headers always added to URL-M and Timegate responses
ikreymer added a commit to ukwa/pywb that referenced this issue Feb 28, 2018
- support Prefer on top-frame url in framed mode, Prefer check runs before custom response
- update Prefer test fixtures to test framed vs frameless and no-mod vs mp_ modifier, all combinations
ikreymer added a commit that referenced this issue Feb 28, 2018
@ikreymer
Copy link
Contributor Author

Support for Prefer: raw and Prefer: rewritten headers added, which causes a redirect to the appropriate raw or rewritten resource, urls with a id_ or mp_ modifier. The Preference-Applied: raw or Preference-Applied: rewritten header is also applied on response.

The implementation is a compromise between suggested approaches, and works both on a Memento TimeGate and Memento (URL-M). The Prefer header serves as an override on the timestamp modifier in the URL, and results in a redirect to the 'canonical' representation with the correct modifier. (The 'canonical' representation for raw memento is always with id_ modifier and for rewritten memento, it is with themp_ modifier in framed replay, and no modifier in frameless mode.)

Example usage tests added to prefer.robot

N0taN3rd pushed a commit to webrecorder/pywb that referenced this issue Sep 3, 2019
…raw' or 'rewritten' mementos (ukwa/ukwa-pywb#12, based on mementoweb/rfc-extensions#6)

- 'enable_prefer: true' in config can be used to enable experimental Memento Prefer behavior
- Prefer header support both redirect and non-redirect style negotiation, extending existing Memento patterns
- Prefer header can be applied both on memento and timegate endpoints
- for redirect style negotiation, Prefer results in a redirect to final memento (if needed), both on Timegate and URL-M (Memento Pattern 2.3)
- for non-redirect style negotiation (Memento Pattern 2.2), Prefer header affects content being served and changes the Content-Location to the canonical representation
- Vary: Prefer and Preference-Applied headers always added to URL-M and Timegate responses
N0taN3rd pushed a commit to webrecorder/pywb that referenced this issue Sep 3, 2019
- support Prefer on top-frame url in framed mode, Prefer check runs before custom response
- update Prefer test fixtures to test framed vs frameless and no-mod vs mp_ modifier, all combinations
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