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

Support using Prefer to obtain the raw memento #434

Open
machawk1 opened this issue Jul 11, 2018 · 2 comments
Open

Support using Prefer to obtain the raw memento #434

machawk1 opened this issue Jul 11, 2018 · 2 comments

Comments

@machawk1
Copy link
Member

RewritingRerouting is currently performed via JS using Reconstructive. The replay system still adds script tags to cause JS to be injected on the client side. We should allow client to obtain the raw mementos' contents.

I believe pywb has implemented this. We should investigate that project's approach to evaluate current support in replay system(s).

http://ws-dl.blogspot.com/2016/08/2016-08-15-mementos-in-raw-take-two.html

/cc @shawnmjones

@machawk1
Copy link
Member Author

machawk1 commented Aug 7, 2018

There may be a potential caveat in using request.headers.get('headerName') from flask if multiple Prefers are used. For example:

curl -H "Prefer: radon" -H "Prefer: dukes" http://localhost:5000/memento/20130202100000/memento.us/

when printing request.headers.get('Prefer') for the request. The type of this value is <type 'unicode'>.

Q: In Flask, for multiple instances of the same request header, how does one obtain all instances?

Iterating through all headers would be an effective yet inelegant solution.

Also see pallets/flask#850

@machawk1
Copy link
Member Author

machawk1 commented Aug 7, 2018

request.headers.getlist('prefer') even seems to only return one value ([u'dukes']) despite two being specified in the above curl command.

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

No branches or pull requests

1 participant