Skip to content

Commit 2511e55

Browse files
Merge pull request #51 from terminusdb/fixUTF-8Headers
Added UTF-8 charset to request headers
2 parents 36a0038 + 2619f81 commit 2511e55

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/dispatchRequest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function DispatchRequest(url, action, payload, local_auth, remote_auth = null, c
7979
case CONST.DELETE:
8080
if (payload) {
8181
options.headers = options.headers ? options.headers : {}
82-
options.headers['Content-Type'] = 'application/json'
82+
options.headers['Content-Type'] = 'application/json; charset=utf-8'
8383
options.data = payload
8484
}
8585
return axiosInstance
@@ -108,7 +108,7 @@ function DispatchRequest(url, action, payload, local_auth, remote_auth = null, c
108108
case CONST.ADD_CSV:
109109
case CONST.INSERT_TRIPLES:
110110
options.headers = options.headers ? options.headers : {}
111-
options.headers['Content-Type'] = 'application/form-data'
111+
options.headers['Content-Type'] = 'application/form-data; charset=utf-8'
112112
return axiosInstance
113113
.put(url, payload, options)
114114
.then(response => response.data)
@@ -119,7 +119,7 @@ function DispatchRequest(url, action, payload, local_auth, remote_auth = null, c
119119
})
120120
case CONST.PUT:
121121
options.headers = options.headers ? options.headers : {}
122-
options.headers['Content-Type'] = 'application/json'
122+
options.headers['Content-Type'] = 'application/json; charset=utf-8'
123123
return axiosInstance
124124
.put(url, payload, options)
125125
.then(response => response.data)
@@ -133,7 +133,7 @@ function DispatchRequest(url, action, payload, local_auth, remote_auth = null, c
133133
options.headers['X-HTTP-Method-Override'] = 'GET'
134134
default:
135135
options.headers = options.headers ? options.headers : {}
136-
options.headers['Content-Type'] = 'application/json'
136+
options.headers['Content-Type'] = 'application/json; charset=utf-8'
137137
return axiosInstance
138138
.post(url, payload, options)
139139
.then(response => response.data)

0 commit comments

Comments
 (0)