-
Notifications
You must be signed in to change notification settings - Fork 5
NOT_NEEDED: fix: add base64 logo into the email #646
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
base: main
Are you sure you want to change the base?
Conversation
d1fead1 to
7ee87d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds base64 encoding for email logos to work around email client image proxies that may not properly handle SVG or external images. The implementation fetches the logo from its URL, converts it to a base64 data URI, and embeds it directly in the email HTML.
Changes:
- Added
fetchLogoAsBase64function that fetches images, validates size (max 50KB), and converts to base64 data URIs - Updated email sending logic to await base64 conversion of logo before generating email HTML
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@Anmol1696 I've opened a new pull request, #648, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@Anmol1696 I've opened a new pull request, #649, to work on those changes. Once the pull request is ready, I'll request review from you. |
- Add isUrlSafeToFetch validation function that checks: - Only allows HTTP/HTTPS protocols - Blocks localhost and local hostnames - Blocks private IPv4 ranges (10.x, 172.16-31.x, 192.168.x, 169.254.x, 127.x) - Blocks private IPv6 addresses (::1, fe80:, fc00:, fd00:) - Integrate URL validation into fetchLogoAsBase64 before fetching - Return undefined for unsafe URLs instead of attempting fetch - Add warning logs for blocked URLs - Fix unused error variables in catch blocks Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Add SSRF protection to logo URL fetching
Add fetch timeout to prevent email sending hangs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.