mirror of
https://github.com/zoriya/flood.git
synced 2026-06-05 19:54:18 +00:00
Fix wrong XML-RPC body length calculation method which results in SCGI calls failing when multibyte characters are included (#635)
This commit is contained in:
+2
-1
@@ -33,11 +33,12 @@ const sendMethodCall = (methodName, parameters) => {
|
||||
const deserializer = new Deserializer('utf8');
|
||||
const stream = net.connect(connectMethod);
|
||||
const xml = Serializer.serializeMethodCall(methodName, parameters);
|
||||
const xmlLength = Buffer.byteLength(xml, 'utf8');
|
||||
|
||||
stream.setEncoding('UTF8');
|
||||
|
||||
const headerItems = [
|
||||
`CONTENT_LENGTH${nullChar}${xml.length}${nullChar}`,
|
||||
`CONTENT_LENGTH${nullChar}${xmlLength}${nullChar}`,
|
||||
`SCGI${nullChar}1${nullChar}`
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user