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: encode buffer responses from cached event handler #1969

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

harlan-zw
Copy link
Contributor

πŸ”— Linked issue

#1894

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Caching an endpoint that returns a buffer will break the endpoint. As an easy fix, we just base 64 encode whatever the result is and mark it as so.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@harlan-zw harlan-zw changed the title fix: base64 encode buffer response from cached event handlers fix: encode buffer responses from cached event handler Nov 30, 2023
@pi0
Copy link
Member

pi0 commented Nov 30, 2023

As of discussion in #1894, I think we might use raw methods of unstorage (behind a flag) also unstorage should automatically handle base64 transformation for drivers not supporting natively binary data if it does not it is something to fix there.

@harlan-zw
Copy link
Contributor Author

harlan-zw commented Nov 30, 2023

As of discussion in #1894, I think we might use raw methods of unstorage (behind a flag) also unstorage should automatically handle base64 transformation for drivers not supporting natively binary data if it does not it is something to fix there.

I agree, that seems like quite a bit of work though and I don't think I have enough context to attempt it.

Perhaps we can merge this as a temporary fix until that's ready? Not sure what else I can do to unblock myself with this bug.

@pi0 pi0 marked this pull request as draft May 7, 2024 17:59
@pi0
Copy link
Member

pi0 commented May 7, 2024

(was hoping to rebase with latest undio version to support at least all h3 binary types including streams. might delay to prioritize other reactors sorry for this delay it is an important issue)

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.

None yet

2 participants