Add 'credentials: include' to fetch request in loadImage()
@Ashley-Y-Lin is already working on this.
Since Mar 27, 2023.
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Most appropriate sub-area of p5.js?
- Color
- Core/Environment/Rendering
- Data
- Dom
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Other (specify if possible)
New feature details:
I recently found an issue with p5.js loadImage() and how the fetch() request handled cookies in Safari (macOS/iOS) and Chrome (iOS). Due to Apple-specific security features, cookies were not being attached for image requests.
I'm using Express.js middleware to manage user sessions/issue cookies and the requests from loadImage() were not aware of the session cookie, causing the request to fail. This can evidently be fixed by including credentials: include in the fetch request.
If possible, this would be a useful addition to the library for others who encounter a similar situation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.