diff --git a/dist/serve.cjs b/dist/serve.cjs index 79f3fdf..2fbe5de 100644 --- a/dist/serve.cjs +++ b/dist/serve.cjs @@ -67,14 +67,13 @@ function serve(ezccip, { for await (let x of req) v.push(x); let { sender, data: calldata } = JSON.parse(Buffer.concat(v)); let match = url.match(/\/(0x[a-f0-9]{40})(?:\b|\/|\?)/i); - origin = match ? match[1] : parseOrigin(url) || origin; let { data, history } = await ezccip.handleRead(sender, calldata, { ...a, - origin, url, ip, protocol, - signingKey + signingKey, + origin: match ? match[1] : parseOrigin(url) || origin }); log?.(ip, url, history.toString()); write_json(reply, { data }); diff --git a/dist/serve.mjs b/dist/serve.mjs index 8a39159..aeb9e31 100644 --- a/dist/serve.mjs +++ b/dist/serve.mjs @@ -44,14 +44,13 @@ function serve(ezccip, { for await (let x of req) v.push(x); let { sender, data: calldata } = JSON.parse(Buffer.concat(v)); let match = url.match(/\/(0x[a-f0-9]{40})(?:\b|\/|\?)/i); - origin = match ? match[1] : parseOrigin(url) || origin; let { data, history } = await ezccip.handleRead(sender, calldata, { ...a, - origin, url, ip, protocol, - signingKey + signingKey, + origin: match ? match[1] : parseOrigin(url) || origin }); log?.(ip, url, history.toString()); write_json(reply, { data }); diff --git a/package.json b/package.json index afc5d69..3c2f70f 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@resolverworks/ezccip", - "version": "0.0.19", + "version": "0.0.20", "type": "module", "scripts": { "test": "node test/all.js", diff --git a/src/serve.js b/src/serve.js index 57e3b84..15dd5b7 100755 --- a/src/serve.js +++ b/src/serve.js @@ -43,9 +43,9 @@ export function serve(ezccip, { for await (let x of req) v.push(x); let {sender, data: calldata} = JSON.parse(Buffer.concat(v)); let match = url.match(/\/(0x[a-f0-9]{40})(?:\b|\/|\?)/i); - origin = match ? match[1] : (parseOrigin(url) || origin); let {data, history} = await ezccip.handleRead(sender, calldata, { - ...a, origin, url, ip, protocol, signingKey, + ...a, url, ip, protocol, signingKey, + origin: match ? match[1] : (parseOrigin(url) || origin) }); log?.(ip, url, history.toString()); write_json(reply, {data});