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

feat(start): data guard when sending binary data to GET server functions #3444

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nikolovlazar
Copy link

Implementing a data guard that checks if the data we're sending to a GET server function contains binary data (unserializable in query params).

Video Walkthrough
👆 Video walkthrough

This PR covers two scenarios:

  • When we're sending binary data to a GET server function (lines 40-44)
  • When we're sending binary data to a POST server function, but within a payload instead of FormData (lines 61-65)

This is my first time contributing to Start, so let me know if I'm missing anything (I didn't write tests for this behavior 😬), or if I should push the example that I showed in the video.

@schiller-manuel
Copy link
Contributor

we should also prevent this at the type level I guess?

@nikolovlazar
Copy link
Author

@schiller-manuel didn't realize we could. Could you give me some pointers?

@schiller-manuel
Copy link
Contributor

this would need to cause a typescript error if the data is not serialzable as query and GET is the method.

let's ask @chorobin

@nikolovlazar
Copy link
Author

I can't seem to figure this out 😅

@webdevcody
Copy link

webdevcody commented Mar 27, 2025

this would be great! I just spent time debugging why my FormData File was becoming a string on my server action just to forget to just a POST instead of a GET

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.

4 participants