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

fix: allow credentials option in Image #2130

Merged

Conversation

PoornakumarRasiraju
Copy link
Contributor

Description of change:
Added credentials option which is required in fetch in order to send cookies in cross-origin requests.
src: mdn web docs

image

This PR also fixes the issue #1412

@@ -6,7 +6,7 @@ type SourceBuffer = Buffer

type SourceDataBuffer = { data: Buffer; format: 'png' | 'jpg' }

type SourceURLObject = { uri: string; method: HTTPMethod; body: any; headers: any }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info:
image

Copy link
Collaborator

@jeetiss jeetiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. PR looks nice, I hope i can merge it soon

packages/image/src/resolve.js Outdated Show resolved Hide resolved
@filianer
Copy link

Please merge this, thank you very much

@daniiiboy
Copy link

I don't see this merged, Is there any chance we could add the credentials flag? Or is there another workaround for fetching images with a cookie. Thank you!

@JakobHelgi
Copy link

Can you merge this please what's the hold up!

Co-authored-by: Dmitry Ivakhnenko <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2023

🦋 Changeset detected

Latest commit: 7446c2c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@react-pdf/image Patch
@react-pdf/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@diegomura diegomura changed the title fix: Allow credentials option in Image fix: allow credentials option in Image Oct 23, 2023
@diegomura diegomura merged commit 4a55c1b into diegomura:master Oct 23, 2023
1 check passed
@JakobHelgi
Copy link

Fantastic, can we get a new release too! 🙏 ❤️

@nikischin
Copy link
Contributor

This just saved my day! However, unfortunately I miss this part in the docs, is there a way to contribute to the docs?

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

Successfully merging this pull request may close these issues.

7 participants