A way to obsure a specific internal URL?
-
Hi,
I am using AmCharts wordpress plugin to generate graphs on a wordpress page. To have the graph load its shape and (external) data, AmCharts uses Javascript to load on the client side when generating the graph. However, this javascript also contains the URL to the API used to retrieve the data. So anyone can easily see the web site code and see this link on the page. This is a risk as anybody can now manipulate the url and download our full database with data.
I have added the first part of the Javascript code below with the URL highlighted that I would like to obscure from users.
Anyway this is possible to do with your plugin or other methods?
Thanks for any help.<script>
try {
/**
* —————————————
* This was created using amCharts 4.
*
* For more information visit:
* https://www.amcharts.com/
*
* Documentation is available at:
* https://www.amcharts.com/docs/v4/
* —————————————
*/// Themes begin
var chart = am4core.create(“amchart1”, am4charts.XYChart);
var from = Math.round(+new Date() / 1000) – 2629743;
var to = Math.round(+new Date() / 1000) + 2629743;chart.dataSource.url = ‘https://api.xxxxxxx.com/’ + from + ‘/’ + to;
chart.dataSource.events.on(“parseended”, function(ev) {
// parsed data is assigned to data source’sdata
property
var data = ev.target.data;
for (var i = 0; i < data.length; i++) {
if(data[i][“realtime_value”] == 0){
delete data[i][“realtime_value”];
}
}console.log(‘data’, data);
});
// create date axis
- The topic ‘A way to obsure a specific internal URL?’ is closed to new replies.