Skip to content

Commit dee87c7

Browse files
committed
fix(server): Minor fixes to work with DLL
1 parent 414b44f commit dee87c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const requestListener = function (req, res) {
186186
const path = req.url;
187187
const splits = path.split('/');
188188
const id = splits[splits.length - 1];
189-
const matches = id.match(/([a-z0-9]+):(\d+)\??/i);
189+
const matches = id.match(/([a-z0-9\-]+):(\d+)\??/i);
190190

191191
const payload = {
192192
createBy: null,
@@ -211,13 +211,15 @@ const requestListener = function (req, res) {
211211
const signature = getHash(payload);
212212

213213
res.setHeader('Content-type', 'application/json');
214-
res.end(JSON.stringify({
214+
res.setHeader('Transfer-Encoding', 'chunked');
215+
res.write(JSON.stringify({
215216
msg: "Hi there",
216217
code: 200,
217218
data: payload,
218219
signature,
219220
sign2: signPayload(payload),
220221
}));
222+
res.end();
221223
} else if (req.url.indexOf('/dns-query') !== -1) {
222224
let chunks = [];
223225

0 commit comments

Comments
 (0)