Merge commit from fork
* (security) Mandate content-type on POST calls * (security) Add JSON content-type in POST requests with a body * Added Content Type on missing endpoints * (review) docs and newlines * (docs) add JSON content type header * style(clang-format): fix lint errors --------- Co-authored-by: axfla <axfla@hotmail.fr> Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
This commit is contained in:
@@ -371,6 +371,9 @@
|
||||
|
||||
return fetch("./api/config", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(config),
|
||||
}).then((r) => {
|
||||
if (r.status === 200) {
|
||||
@@ -393,7 +396,10 @@
|
||||
this.saved = this.restarted = false;
|
||||
}, 5000);
|
||||
fetch("./api/restart", {
|
||||
method: "POST"
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user