Handle inconsistent header case for Mementos #101
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #98, which was caused by two changes:
'x-archive-org-'
) in lower-case.Since that means it’s possible to wind up with different header name casing when running the same code on different systems, I had to go ahead and make the
Memento.headers
attribute case-insensitive (we probably should have done this long ago for user friendliness anyway). I've implemented that using code largely taken from Requests, since their implementation is not public so we can't just use it directly (plus we plan to switch of Requests at some point anyway). If we wind up switching to HTTPX, they do have a public implementation we can just use instead of this.