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

HTTPS GET on PDF returns blank pages, but functions normally with HTTP #3927

Closed
yetitech-david opened this issue Aug 2, 2021 · 5 comments
Closed

Comments

@yetitech-david
Copy link

Describe the issue

I am using axios to retrieve a PDF file from a given URL. It functions correctly when passing through an HTTP URL, but when using HTTPS, the resulting PDF has the correct page count but every page is completely blank

Example Code

const data = await axios({
      url: url,
      method: 'get',
      responseType: 'blob',
      headers: {},
    }).then((response) => {
      return response.data;
    });

Expected behavior, if applicable

The response should be a string version of the PDF, which is passed through a buffer and stored in a database as a PDF file, which works fine when given an HTTP URL, but not when an SSL certificate is introduced

Environment

  • Axios Version 0.21.1
  • Adapter HTTP
  • Browser Chrome
  • Browser Version 91.0.4472.114
  • Node.js Version v14.17.1
  • OS: Linux Mint 20.1 Cinnamon
  • Additional Library Versions React 16.14.0

Additional context/Screenshots

Add any other context about the problem here. If applicable, add screenshots to help explain.

@anshul2807
Copy link

I'm going to work on this issue.

@chiefkana
Copy link

Looks like subsequent issue after this one #3526

@jasonsaayman
Copy link
Member

This should work, please retry with the latest version and open a new issue if it is still not working

@heremamit
Copy link

set responseType as
responseType: 'arraybuffer',

@spiritcoder
Copy link

set responseType as responseType: 'arraybuffer',

thanks for this.

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

6 participants