braid-http 1.3.38 → 1.3.39
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.
- package/braid-http-client.js +1 -1
- package/braid-http-server.js +3 -3
- package/package.json +1 -1
package/braid-http-client.js
CHANGED
|
@@ -947,7 +947,7 @@ async function multiplex_fetch(url, params, skip_multiplex_method) {
|
|
|
947
947
|
try {
|
|
948
948
|
var res = await normal_fetch(url, params)
|
|
949
949
|
|
|
950
|
-
if (res.status ===
|
|
950
|
+
if (res.status === 424 && !(await promise_done(mux_promise))) {
|
|
951
951
|
// this error will trigger a retry if the user is using that option
|
|
952
952
|
throw new Error('multiplexer not yet connected')
|
|
953
953
|
}
|
package/braid-http-server.js
CHANGED
|
@@ -290,14 +290,14 @@ function braidify (req, res, next) {
|
|
|
290
290
|
// if the multiplexer doesn't exist, send an error
|
|
291
291
|
var m = braidify.multiplexers?.get(multiplexer)
|
|
292
292
|
if (!m) {
|
|
293
|
-
res.writeHead(
|
|
293
|
+
res.writeHead(404, 'Multiplexer no exist', {'Bad-Multiplexer': multiplexer})
|
|
294
294
|
return res.end(`multiplexer ${multiplexer} does not exist`)
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
// if the stream doesn't exist, send an error
|
|
298
298
|
let s = m.streams.get(stream)
|
|
299
299
|
if (!s) {
|
|
300
|
-
res.writeHead(
|
|
300
|
+
res.writeHead(404, 'Stream no exist', {'Bad-Stream': stream})
|
|
301
301
|
return res.end(`stream ${stream} does not exist`)
|
|
302
302
|
}
|
|
303
303
|
|
|
@@ -324,7 +324,7 @@ function braidify (req, res, next) {
|
|
|
324
324
|
// find the multiplexer object (contains a response object)
|
|
325
325
|
var m = braidify.multiplexers?.get(multiplexer)
|
|
326
326
|
if (!m) {
|
|
327
|
-
res.writeHead(
|
|
327
|
+
res.writeHead(424, 'Multiplexer no exist', {'Bad-Multiplexer': multiplexer})
|
|
328
328
|
return res.end(`multiplexer ${multiplexer} does not exist`)
|
|
329
329
|
}
|
|
330
330
|
|