-
Notifications
You must be signed in to change notification settings - Fork 10
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
Allow to specify how the uuid for a file is computed as the new crypto.randomUUID forces the use of https #22
Comments
Could you use a hook on Otherwise, I'm open to implement a fallback function if the context is not secure, that would be easier than asking consuming code to work around this issue. |
In my understanding:
Maybe I misunderstand the functionality, but it seems to me as if an explicit API that allows to use an alternative to |
Are you willing to work on a PR for:
for the custom function, you can use this: |
I can create a PR but still do not understand if you really just want to have a fallback? It is my understanding that this change was made to prevent uploading without https in the first place and would this fallback not contradict the original intention? |
Initially, this change was made so instead of a custom function, we use the browser's implementation, which results in less line of code for this library, and thus (slightly) enhanced maintainability. That was the original incentive. The fact that secure context is mandatory for this function to run wasn't considered an issue because HTTPS should be default by now, and it considers localhost secure so dev is not impacted. Using the custom fallback doesn't cause any security issue, it just generates a UUID string, it is not used to encrypt state secrets, so the secure context isn't really needed here. Interestingly, there is a lengthy discussion here about whether randomUUID should require secureContext. Sadly, I don't think this will be changed now anyway :/ So while I don't look forward to adding a branch in the code, if it solves an issue users have, it's worth considering. We could also just remove the
Can you be more verbose? How are you testing things and where does the problem lie exactly? |
Thank you for the explanation. |
I just pushed #24 |
In version 7.1.0 a change was made (Use crypto.randomUUID instead of a custom function) that now uses
crypto.randomUUID
and therefore restricts the use of file uploads by forcing the use of http if not running on localhost.Although I completely understand why this has been changed, it somehow restricts the usability in distributed test environment.
Is there away to customise this behaviour or else would it be possible to offer some customisation on how to calculate a new uuid?
The text was updated successfully, but these errors were encountered: