highcharts / highcharts/node-export-server
v4: no error is thrown when callback is set and it's a file but allowFileResources is not set to true
- Dominant language
- JavaScript
- Stars
- 369
- Forks
- 266
- PR merge metrics
- No merged PRs in 30d
Description
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.
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 error `no such file or directory, open 'some-invalid-path.json'`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.