Client should shutdown write after send all request data, so pybeautifier server will receive an empty chunk.

This commit is contained in:
spicy-sauce 2021-06-11 17:06:21 +03:00
parent 41d5051b39
commit 6df7403c63
1 changed files with 1 additions and 0 deletions

View File

@ -23,6 +23,7 @@ format = (data, formatters) ->
client.connect PORT, HOST, ->
client.setEncoding('utf8')
client.write(JSON.stringify({'data': data, 'formatters': formatters}))
client.end()
response = ''
client.on 'data', (chunk) ->
response += chunk