-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: Allow serving of images from an S3 bucket #335
Conversation
res.status(200); | ||
res.end('Error Fetching File'); | ||
} else { | ||
res.writeHead(200, { 'Content-Type': mime.lookup(params.Key) }); |
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.
Shouldn't you be able to get the content type from data.Headers.ContentType
? Instead of relying on the extension (which is what I assume mime.lookup does)
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.
That's an interesting point! I'll see if I can do that.
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.
It ended up being data.ContentType
but good catch!
🎉 This PR is included in version 2.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
What does this do?
This serves an image based on the url.
How was it tested?
Locally
Is there a Github issue this is resolving?
N/A
Was any impacted documentation updated to reflect this change?
Yes. However, I'm not sure I want to document
/api/images
Here's a fun image for your troubles