Open DanielRuf opened 1 month ago
Also no error is thrown if the file defined for --globalOptions
contains invalid JSON.
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: https://github.com/highcharts/node-export-server/pull/561 (full options validation with zod
)
When we set
allowCodeExecution
tofalse
, we getThe 'callback', 'resources' and 'customCode' options have been disabled for this server.
When we set
allowCodeExecution
totrue
, we get no error.But when we set
callback
to a file, it silently ignores it. No error or warning is provided, thatallowFileResources
has to be enabled / set totrue
.That is not ideal and makes debugging harder.
https://github.com/highcharts/node-export-server/blob/e7409447ab621ef4df3da5da70e67edb7b9b1707/lib/chart.js#L416
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 errorno such file or directory, open 'some-invalid-path.json'