Fix #179: Can't send empty string with utf8 serializer

This commit is contained in:
Sefa Ilkimen
2019-01-17 17:03:12 +01:00
parent dadbf97d0c
commit 6033ea4b76
2 changed files with 10 additions and 3 deletions
+1 -3
View File
@@ -213,8 +213,6 @@ function getAllowedDataTypes(dataSerializer) {
}
function getProcessedData(data, dataSerializer) {
data = data || {};
var currentDataType = getTypeOf(data);
var allowedDataTypes = getAllowedDataTypes(dataSerializer);
@@ -248,7 +246,7 @@ function handleMissingOptions(options, globals) {
timeout: checkTimeoutValue(options.timeout || globals.timeout),
headers: checkHeadersObject(options.headers || {}),
params: checkParamsObject(options.params || {}),
data: options.data || null,
data: getTypeOf(options.data) === 'Undefined' ? null : options.data,
filePath: options.filePath || '',
name: options.name || ''
};