Merge branch 'main' into form_data_imp

This commit is contained in:
Ashita Prasad
2024-01-07 15:50:20 +05:30
committed by GitHub
5 changed files with 13 additions and 19 deletions

View File

@ -152,10 +152,7 @@ body = b'\r\n'.join(dataList)
if (headers.isNotEmpty || hasBody) {
hasHeaders = true;
bool hasContentTypeHeader = headers.keys
.any((k) => k.toLowerCase() == HttpHeaders.contentTypeHeader);
if (hasBody && !hasContentTypeHeader) {
if (hasBody && !requestModel.hasContentTypeHeader) {
headers[HttpHeaders.contentTypeHeader] =
kContentTypeMap[requestModel.requestBodyContentType] ?? "";
}