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

Unfairly Failing the cors test? #99

Open
anguelos opened this issue Mar 11, 2024 · 0 comments
Open

Unfairly Failing the cors test? #99

anguelos opened this issue Mar 11, 2024 · 0 comments

Comments

@anguelos
Copy link

I am trying to write a compliant flask service.
I fail many test's were my understanding is I should not.

As I debug through chrome this what I get when asking for info.json:

HTTP/1.1 200 OK
Server: Werkzeug/2.2.3 Python/3.11.5
Date: Mon, 11 Mar 2024 12:07:05 GMT
Content-Type: application/ld+json
Content-Length: 298
Access-Control-Allow-Origin: *
Connection: close

And this is what I get when asking for the actual image:

HTTP/1.1 200 OK
Server: Werkzeug/2.2.3 Python/3.11.5
Date: Mon, 11 Mar 2024 12:17:26 GMT
Content-Type: image/jpeg
Content-Length: 870044
Cache-Control: no-cache
Date: Mon, 11 Mar 2024 12:17:26 GMT
Access-Control-Allow-Origin: *
Connection: close

Yet the testcase on the cli gives me:

test cors FAIL
  url: ['http://localhost:4000/iiif/caf5f770c38679680655f538ae3b3438/info.json']
  got: http://iiif.io/
  expected: *
  type: CORS
  message: 
  Is Warning?: False

The URL http://iiif.io/ does not exist anywhere in my code.
And is only contained as a super string for the info.json generating dictionary:

tecnical_properties = {
        "@context": "http://iiif.io/api/image/3/context.json",
        "id":img_url,
        "type": "ImageService3",
        "protocol": "http://iiif.io/api/image",
        "profile": "level2",
        "width": image.size[0],
        "height": image.size[1],
        "maxWidth": global_max_width,
        "maxHeight": global_max_height,
        "maxArea": global_max_width * global_max_height, # FOR NOW THIS HAS TO BE THE PRODUCT OF maxWidth and maxHeight
    }

I am running on localhost although I think this should not mater.

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