-
-
Couldn't load subscription status.
- Fork 4.6k
fix(files_sharing): fallback self.crypto.getRandomValues #53635
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
Conversation
| * @param {Uint8Array} array - The array to fill with random values. | ||
| */ | ||
| function getRandomValues(array: Uint8Array): void { | ||
| if (self?.crypto?.getRandomValues) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (self?.crypto?.getRandomValues) { | |
| if (self.crypto?.getRandomValues) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eehehe I thought self could also be undefined sometimes 🤭🤭
I guess we're adamant this is the browser anyway so yeah, maybe not needed 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you expect self to be undefined, then just use globalThis instead ;)
HTTP is not the only source, IIRC we use Nevertheless as long as we support non-https for users we should also fix this here. |
It failed on viewer cypress tests. I guess it's because of the docker IP ?🤔 |
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
04c9868 to
3cff9d8
Compare
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
/backport to stable31 |
|
/backport to stable30 |
On tests, we have a non-secure env (HTTP), some users might also use without ssl on their local instances