@rest-vir/define-service 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -99,7 +99,11 @@ export function buildEndpointRequestInit(endpoint, ...[{ method, options = {}, p
|
|
|
99
99
|
const hasContentTypeHeader = Object.keys(headers).some((headerKey) => headerKey.toLowerCase() === 'content-type');
|
|
100
100
|
if (!hasContentTypeHeader) {
|
|
101
101
|
if (requestData instanceof FormData) {
|
|
102
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Do not set `content-type` manually when submitting form data because the browser will
|
|
104
|
+
* set it automatically _and_ include a boundary in the content type, which is needed
|
|
105
|
+
* for reading the form data properly.
|
|
106
|
+
*/
|
|
103
107
|
}
|
|
104
108
|
else if (check.isObject(requestData)) {
|
|
105
109
|
headers['content-type'] = 'application/json';
|