I am trying existing backend code using JavaScript:
fetch(someURL)
.then(res => res.json())
.then(data => console.log(data));
However, I noticed that the response header is saying
content-type: application/x-javascript
so it is not JSON and the .json()
call would fail, and the data returned seems to be text and contains:
for(;;);{"_some_var":1,"payload":{ ... // many properties and values here
What is happening and what is a proper way to get the values returned?