Skip to content

fix: sveltekit server endpoint buffer response #159

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

Closed
wants to merge 6 commits into from

Conversation

m3tasploit
Copy link
Contributor

Fix for corrupt images when responding with image/jpeg or any binary data from sveltekit Api endpoint

@m3tasploit m3tasploit requested review from a team as code owners April 6, 2024 12:02
@jamesdaniels
Copy link
Collaborator

@m3tasploit LGTM. Q, does the text content-type repsonse work ok if you always respond with a buffer? Best to avoid conditionals when possible

@m3tasploit
Copy link
Contributor Author

m3tasploit commented Apr 19, 2024

Oh, sorry i forgot that case, I'll try different content types and update code if necessary

@m3tasploit
Copy link
Contributor Author

@m3tasploit LGTM. Q, does the text content-type repsonse work ok if you always respond with a buffer? Best to avoid conditionals when possible

I've added check for commonly used text content-types. I'm not sure if this is the correct way to go.

@leoortizz
Copy link
Contributor

Hey @m3tasploit, thanks for creating this PR. I did a few tests and found that if we always respond with a buffer it also works, therefore avoiding conditionals. Implemented in #205.

@leoortizz
Copy link
Contributor

Merged in #205

@leoortizz leoortizz closed this Jun 24, 2024
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.

3 participants