braid-http 1.3.42 → 1.3.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -340,6 +340,16 @@ function braidify (req, res, next) {
340
340
  return res.end(`multiplexer ${multiplexer} does not exist`)
341
341
  }
342
342
 
343
+ // if this request-id already exists, respond with an error
344
+ if (m.requests.has(request)) {
345
+ res.writeHead(409, 'Conflict', {'Content-Type': 'application/json'})
346
+ return res.end(JSON.stringify({
347
+ error: 'Request already exists',
348
+ message: `Cannot create duplicate request with ID '${request}'`,
349
+ details: 'This request ID must be unique'
350
+ }))
351
+ }
352
+
343
353
  m.res.write(`start request ${request}\r\n`)
344
354
 
345
355
  // let the requester know we've multiplexed their response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "1.3.42",
3
+ "version": "1.3.43",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"