Merge branch 'dev' into 'dev'

Proposal to resolve error where postData was being sent on a GET request.

See merge request Shinobi-Systems/Shinobi!449
cycling-live-grid
Moe 2023-03-19 17:22:23 +00:00
commit b2b6d4b3f8
1 changed files with 15 additions and 5 deletions

View File

@ -47,11 +47,21 @@ module.exports = function(s,config,lang){
ok: true,
type: lang[doStart ? 'Control Triggered' : 'Control Trigger Ended']
}
const theRequest = fetchWithAuthentication(requestUrl,{
method: controlUrlMethod || controlOptions.method,
digestAuth: hasDigestAuthEnabled,
postData: controlOptions.postData || null
});
var fetchWithAuthData;
if (controlOptions.postData){
fetchWithAuthData = {
method: controlUrlMethod || controlOptions.method,
digestAuth: hasDigestAuthEnabled,
postData: controlOptions.postData
}
}
else{
fetchWithAuthData = {
method: controlUrlMethod || controlOptions.method,
digestAuth: hasDigestAuthEnabled
}
}
const theRequest = fetchWithAuthentication(requestUrl,fetchWithAuthData);
theRequest.then(res => res.text())
.then((data) => {
if(doStart){