v1.9.4
Set empty response when change role or change key value because http response is 204. In order to make change role or change key value work, via JavaScript, we need to hack response little bit. Here's the code sample.
document.getElementById('roles').onchange = function() {
fetch('<?php echo site_url('web-session/change-role'); ?>', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
},
body: request,
credentials: 'same-origin'
})
.then(response => {
if (response.status === 204) return ''; // <= In order to make response work when http code 204
return response.json()
})
.then(data => {
// Do something
})
.catch(error => {
console.error(error)
})
}
More detail please see: whatwg/fetch#113 (comment)
Full Changelog: v1.9.3...v1.9.4