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

HTTP call inside validation function in design document? #5042

Closed
hubodz opened this issue Apr 28, 2024 · 2 comments
Closed

HTTP call inside validation function in design document? #5042

hubodz opened this issue Apr 28, 2024 · 2 comments

Comments

@hubodz
Copy link

hubodz commented Apr 28, 2024

Hello,
I try to invoke a HTTP call while validating the document (perfectly, I would like to be able to perform the validation in an external endpoint), but when trying to use fetch or create XMLHttpRequest object, I get a ReferenceError.

Is it expected, or there is some kind of bug?

Thanks!

@rnewson
Copy link
Member

rnewson commented Apr 28, 2024

This is deliberately prohibited. a validate_doc_update function can only depend on the input parameters and is sandboxed to prevent any network or file access. This is to ensure the result is deterministic.

@hubodz
Copy link
Author

hubodz commented Apr 28, 2024

Thank you!

@hubodz hubodz closed this as completed Apr 28, 2024
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

No branches or pull requests

2 participants