Skip to content

Unfairly Failing the cors test? #99

@anguelos

Description

@anguelos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions