usnistgov / jsip

JSIP: Java SIP specification Reference Implementation (moved from java.net)
Other
285 stars 129 forks source link

Fixed content-length computation for multipart-contents #82

Open cy-fre opened 1 year ago

cy-fre commented 1 year ago

Added missing UTF-8 charset handling when calculating the length of a multipart content as it is also done when computing the length of a single content. This fixes severe Content-Length issues when wrong encoded UTF-8 characters are used in content. When sending such characters by using the getRawContent() method they may be expanded from one to two bytes and the Content-Length would be wrong.