Hi martians!
Thanks for the awesome tool. I'm working on writing an HTML page which uses the Fetch API to set martian proxy config. I've confirmed that, after issuing a GET /configure to martian, my configuration is pushed. However, I don't see my header added to the responses (I'm checking by looking at Chrome Dev Tools Network tab). I've also tried other demo configs, such as one which performs verification. It seems like martian is not using the config I've pushed. :/
Here's the JS:
const martianPort = 8080;
function postData(url, data) {
console.log('fetch', url, data);
// Default options are marked with *
return fetch(url, {
body: JSON.stringify(data), // must match 'Content-Type' header
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, same-origin, *omit
headers: {
'content-type': 'application/json'
},
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, cors, *same-origin
redirect: 'follow', // manual, *follow, error
referrer: 'no-referrer', // *client, no-referrer
})
.then(response => response)
}
postData(`http://martian.proxy:${martianPort}/configure`, {
"header.Modifier": {
"scope": ["response"],
"name" : "Test-Header",
"value" : "true"
}
}).then(response =>
console.log(response, response.text().then(
text => console.log("response text:", text))));