mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-25 08:53:55 +08:00
Fixed issue preventing FormData posting correctly
- Due to migration from Axios, Instances where we were sending FormData were not considered and always converted to JSON which resulted in empty JSON bodies. Related to #1621
This commit is contained in:
parent
7a4425473b
commit
16d8a667b1
|
@ -67,7 +67,7 @@ async function dataRequest(method, url, data = null) {
|
|||
body: data,
|
||||
};
|
||||
|
||||
if (typeof data === 'object') {
|
||||
if (typeof data === 'object' && !(data instanceof FormData)) {
|
||||
options.headers = {'Content-Type': 'application/json'};
|
||||
options.body = JSON.stringify(data);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user