extra newline after POST

pull/4/head
Zlatin Balevsky 2019-05-25 16:05:35 +01:00
parent 42ddd321ea
commit f0c3a0de9e
2 changed files with 3 additions and 3 deletions

View File

@ -182,9 +182,9 @@ class ConnectionAcceptor {
if (!searchManager.hasLocalSearch(resultsUUID)) if (!searchManager.hasLocalSearch(resultsUUID))
throw new UnexpectedResultsException(resultsUUID.toString()) throw new UnexpectedResultsException(resultsUUID.toString())
byte[] rn = new byte[2] byte[] rn = new byte[4]
dis.readFully(rn) dis.readFully(rn)
if (rn != "\r\n".getBytes(StandardCharsets.US_ASCII)) if (rn != "\r\n\r\n".getBytes(StandardCharsets.US_ASCII))
throw new IOException("invalid request header") throw new IOException("invalid request header")
Persona sender = new Persona(dis) Persona sender = new Persona(dis)

View File

@ -77,7 +77,7 @@ class ResultsSender {
try { try {
endpoint = connector.connect(target) endpoint = connector.connect(target)
DataOutputStream os = new DataOutputStream(endpoint.getOutputStream()) DataOutputStream os = new DataOutputStream(endpoint.getOutputStream())
os.write("POST $uuid\r\n".getBytes(StandardCharsets.US_ASCII)) os.write("POST $uuid\r\n\r\n".getBytes(StandardCharsets.US_ASCII))
me.write(os) me.write(os)
os.writeShort((short)results.length) os.writeShort((short)results.length)
results.each { results.each {