Skip to content

feat:encode sfn > functionId & extractedFilename #1872

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

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

Conversation

thinke5
Copy link

@thinke5 thinke5 commented Mar 27, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

What is the current behavior?

image

What is the new behavior?

image

Other information

The encoded characters are guaranteed to be ASCII characters, and the path before src is removed to improve security and reduce string size

Currently encoded as base64, the size increases by 25%, but I don't know if there is a better way

Copy link

changeset-bot bot commented Mar 27, 2025

⚠️ No Changeset found

Latest commit: b640817

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Mar 27, 2025

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit b640817
🔍 Latest deploy log https://app.netlify.com/sites/solid-start-landing-page/deploys/67ec9cd71d4b760008d7a51b
😎 Deploy Preview https://deploy-preview-1872--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lxsmnsyc
Copy link
Member

lxsmnsyc commented Mar 27, 2025

Could probably use a simple hash such as a xxhash32(filename), but otherwise this is fine.

@thinke5
Copy link
Author

thinke5 commented Mar 27, 2025

Could probably use a simple hash such as a xxhash32(filename), but otherwise this is fine.

Hash functions are usually irreversible.

if use encryption algorithms (such as AES) or compression algorithms (such as lz-string), need to decode it every time call handleServerFunction, which may cause high CPU consumption and network latency.

So I choose to use base64 for now.

@thinke5
Copy link
Author

thinke5 commented Mar 27, 2025

I have come up with a solution that can use hash algorithm,` HandleServerFunction does not require decoding. I need some time to verify

@lxsmnsyc
Copy link
Member

I don't think we need to decode anything. We just use the IDs for lookup and verification anyways.

@thinke5
Copy link
Author

thinke5 commented Mar 28, 2025

Now,only Encode extractedFilename with encodeURIComponent.

In addition, I found that extractedFilename is not used in this process, 🤔 maybe it can be removed?

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.

[Bug?]: 'use server' will cause an error when there is Chinese in the file path
2 participants