braid-http 1.3.18 → 1.3.19

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.
@@ -859,10 +859,7 @@ async function multiplex_fetch(url, params) {
859
859
 
860
860
  // attempt to establish a multiplexed connection
861
861
  try {
862
- if (braid_fetch.use_multiplexing === 'USE GET')
863
- var r = await braid_fetch(`${origin}/MULTIPLEX/${multiplexer}`, {retry: true})
864
- else
865
- var r = await braid_fetch(`${origin}/${multiplexer}`, {method: 'MULTIPLEX', retry: true})
862
+ var r = await braid_fetch(`${origin}/${multiplexer}`, {method: 'MULTIPLEX', retry: true})
866
863
  } catch (e) {
867
864
  // fallback to normal fetch if multiplexed connection fails
868
865
  console.error(`Could not establish multiplexed connection.\nGot error: ${e}.\nFalling back to normal connection.`)
@@ -925,10 +922,7 @@ async function multiplex_fetch(url, params) {
925
922
  stream_error = e
926
923
  bytes_available()
927
924
  try {
928
- if (braid_fetch.use_multiplexing === 'USE GET')
929
- await braid_fetch(`${origin}/MULTIPLEX${params.headers.get('multiplexer')}`, {retry: true})
930
- else
931
- await braid_fetch(`${origin}${params.headers.get('multiplexer')}`, {method: 'MULTIPLEX', retry: true})
925
+ await braid_fetch(`${origin}${params.headers.get('multiplexer')}`, {method: 'MULTIPLEX', retry: true})
932
926
  } catch (e) {
933
927
  console.error(`Could not cancel multiplexed connection:`, e)
934
928
  throw e
@@ -243,10 +243,9 @@ function braidify (req, res, next) {
243
243
  req.subscribe = subscribe
244
244
 
245
245
  // Multiplexer stuff
246
- if ((braidify.use_multiplexing && req.method === 'MULTIPLEX') ||
247
- (braidify.use_multiplexing === 'USE GET' && req.url.startsWith('/MULTIPLEX/'))) {
246
+ if (braidify.use_multiplexing && req.method === 'MULTIPLEX') {
248
247
  // parse the multiplexer id and stream id from the url
249
- var [multiplexer, stream] = req.url.slice(1).replace(/^MULTIPLEX\//, '').split('/')
248
+ var [multiplexer, stream] = req.url.slice(1).split('/')
250
249
 
251
250
  // if there's just a multiplexer, then we're creating a multiplexer..
252
251
  if (!stream) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-http",
3
- "version": "1.3.18",
3
+ "version": "1.3.19",
4
4
  "description": "An implementation of Braid-HTTP for Node.js and Browsers",
5
5
  "scripts": {
6
6
  "test": "node test/server.js"