]>
BookStack Code Mirror - bookstack/commitdiff
projects
/
bookstack
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
7a44254
)
Fixed issue preventing FormData posting correctly
author
Dan Brown
<redacted>
Tue, 3 Sep 2019 20:46:46 +0000
(21:46 +0100)
committer
Dan Brown
<redacted>
Tue, 3 Sep 2019 20:46:46 +0000
(21:46 +0100)
- 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
resources/assets/js/services/http.js
patch
|
blob
|
history
diff --git
a/resources/assets/js/services/http.js
b/resources/assets/js/services/http.js
index 06cc6a04ffeab12b73cbfc21b67905f6c6f9e695..06dac9864a4d4523987e61f4009075ea34ed0594 100644
(file)
--- a/
resources/assets/js/services/http.js
+++ b/
resources/assets/js/services/http.js
@@
-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);
}