Skip to content

Problems with CORS & PDF.JS #10159

@joeangry

Description

@joeangry

Hi.
I'm trying to load a PDF from an external site which I'm also the owner of (Azure App Service). I've added the following headers to all my requests but I get an odd chain of requests whenever I try to load external PDFs.

Headers:

Access-Control-Expose-Headers: Accept-Ranges,Content-Encoding,Content-Length,Content-Range
Access-Control-Allow-Headers: Content-Range,Range

As you can see I get the initial 200 OK just fine followed by two 200 OPTIONS requests. Finally it alternates between 200 and 206 which isn't the expecte behavior.
When I tested it on a local site the initial request got a 200 response followed by 206 until the PDF had fully loaded.

What obvious thing am I missing here?

Configuration:

  • Web browser and its version: Any browser (tested on Chrome lastest, Microsoft Edge lastest, Firefox latest)
  • Operating system and its version: Windows 10, 1809
  • PDF.js version: v1.9.426
  • Is a browser extension: No

What is the expected behavior? (add screenshot)
image

What went wrong? (add screenshot)
image

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