mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 02:05:29 +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:
@ -785,8 +785,11 @@ class InvenTreeAPI {
|
||||
Future<APIResponse> completeRequest(HttpClientRequest request, {String? data, int? statusCode}) async {
|
||||
|
||||
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(
|
||||
|
Reference in New Issue
Block a user