2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 13:36:50 +00:00

Fix for utf character encoding

- content length was being set based on the non-encoded string
- naughty naughty
This commit is contained in:
Oliver 2021-09-17 22:19:57 +10:00
parent cf9c57c9e0
commit a8ca441868
2 changed files with 6 additions and 3 deletions

View File

@ -785,8 +785,11 @@ class InvenTreeAPI {
Future<APIResponse> completeRequest(HttpClientRequest request, {String? data, int? statusCode}) async { Future<APIResponse> completeRequest(HttpClientRequest request, {String? data, int? statusCode}) async {
if (data != null && data.isNotEmpty) { if (data != null && data.isNotEmpty) {
request.headers.set(HttpHeaders.contentLengthHeader, data.length.toString());
request.add(utf8.encode(data)); var encoded_data = utf8.encode(data);
request.headers.set(HttpHeaders.contentLengthHeader, encoded_data.length.toString());
request.add(encoded_data);
} }
APIResponse response = new APIResponse( APIResponse response = new APIResponse(

@ -1 +1 @@
Subproject commit 1dbd8c1ec48b642f63170333a769ad9df83c6baa Subproject commit c7e8c69216e17972432178db6fb2d8b3136e7a06