Fix JP2/WEBP detection, Link header, CORS origin#97
Open
Fix JP2/WEBP detection, Link header, CORS origin#97
Conversation
Wildcards are recommended for broadest access, but request-based origins are still valid. https://iiif.io/api/image/3.0/#71-cors https://www.w3.org/TR/cors/
The `>` character is a more canonical delimiter for the end of a URI, and fixes the original issue of failed parses of URIs containing a valid semicolon. The original use of semicolon and backtracking it seems intentional, but not sure what the original intent or test case might have been.
Python3 changed behavior of strings vs bytes such that a WEBP string constant is not considered equivalent to thel bytes from reading. Change summarized in: https://blog.feabhas.com/2019/02/python-3-unicode-and-byte-strings/
This appears to have been a confusion between filemagic and python-magic,
but not sure where the regression would have been introduced. It was erroring
with:
exception: __enter__
Which was a suppression of the original error:
AttributeError: 'Magic' object has no attribute 'id_buffer'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi - I ran into a few errors when running this - both locally and from iiif.io, so I wanted to propose changes from my findings. It's not clear to me if this repository is still maintained so kept them in a single PR for my own simplicity, but can resubmit to split them up for acceptance or discussion if you prefer.
More technical details are documented in the commit messages, so, to summarize:
http://iiif.io) instead of only a wildcard (previously this case was unsupported)Also, I'm not too sure about the testing practices for discovering if I'm breaking any expectations or simply misunderstood an expected failure. I'd be happy to amend this for test coverage after more guidance.
I would appreciate any feedback you might have on the changes - thanks!