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

v4: no error is thrown when callback is set and it's a file but allowFileResources is not set to true #575

Open
DanielRuf opened this issue Aug 27, 2024 · 2 comments
Assignees
Labels

Comments

@DanielRuf
Copy link

DanielRuf commented Aug 27, 2024

When we set allowCodeExecution to false, we get The 'callback', 'resources' and 'customCode' options have been disabled for this server.

When we set allowCodeExecution to true, we get no error.

But when we set callback to a file, it silently ignores it. No error or warning is provided, that allowFileResources has to be enabled / set to true.

That is not ideal and makes debugging harder.

if (customLogicOptions.allowFileResources) {

To reproduce:

highcharts-export-server --allowCodeExecution true --logToFile false --infile "....in.js" --outfile "...out.jpg" --type "jpg" --globalOptions "....globalOptions.json" --callback "some-invalid-path.js" --width 600 throws no error.

highcharts-export-server --allowCodeExecution true --logToFile false --infile "....in.js" --outfile "...out.jpg" --type "jpg" --globalOptions "....globalOptions.js" --callback "some-invalid-path.js" --allowFileResources true --width 600 throws error no such file or directory, open 'some-invalid-path.json'

@DanielRuf DanielRuf changed the title v4: no error is thrown when callback is set and a file but allowFileResources is not set to true v4: no error is thrown when callback is set and it's a file but allowFileResources is not set to true Aug 28, 2024
@DanielRuf
Copy link
Author

Also no error is thrown if the file defined for --globalOptions contains invalid JSON.

@jszuminski jszuminski added the bug label Aug 28, 2024
@jszuminski
Copy link
Contributor

Thanks for reporting @DanielRuf!

You're right - it should be solved on our side. I have added this to our backlog.

Regarding your second point, @PaulDalek is currently working on this here: #561 (full options validation with zod)

@jszuminski jszuminski self-assigned this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants