Skip to content

Commit

Permalink
feat(brave): streaming compressed payload from gw
Browse files Browse the repository at this point in the history
WIP hapi patch: detect browserified streams in Chrome App environment

Detection via `stream instanceof Stream` does not work correctly in
browser context, especially when different polyfils are used and mixed
together.

This replaces instanceof check with feature-detection, which enables
Hapi to consume stream-like objects, as long they match proper contract.

WIP js-ipfs patch: do proper streaming and content-type sniffing

1. Simplifies code responsible for streaming response and makes the
streaming actually work by telling the payload compression stream to
flush its content on every read().  (previous version was buffering
entire thing in Hapi's compressor memory)

2. Content-type sniffing is now done over first 512 bytes.
  • Loading branch information
lidel committed Apr 3, 2019
1 parent 84fee2a commit 04e842d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 193 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"resolutions": {
"stream-http": "3.0.0",
"multiaddr": "6.0.3",
"hapi": "https://github.com/lidel/hapi/tarball/0961606e2c7dca8eceda765bd31ec2cb58358382/hapi.tar.gz",
"pino": "https://github.com/pinojs/pino/tarball/d4d291cd271af969716ac40afce2ddecc7f3d9fa/pino.tar.gz"
},
"devDependencies": {
Expand Down Expand Up @@ -105,8 +106,8 @@
"webpack-merge": "4.2.1"
},
"dependencies": {
"browser-process-hrtime": "1.0.0",
"@material/switch": "1.0.1",
"browser-process-hrtime": "1.0.0",
"choo": "6.13.1",
"chrome-dgram": "3.0.1",
"chrome-net": "3.3.1",
Expand All @@ -116,7 +117,7 @@
"filesize": "4.1.2",
"http-dns": "3.0.1",
"http-node": "1.2.0",
"ipfs": "https://github.com/ipfs/js-ipfs/tarball/cd2ccb008c1b4f8e5b8982d008546766dcdef6e2/js-ipfs.tar.gz",
"ipfs": "https://github.com/lidel/js-ipfs/tarball/5a6327879a03aac95eb008f746455d7e22891a53/js-ipfs.tar.gz",
"ipfs-css": "0.12.0",
"ipfs-http-client": "30.1.0",
"ipfs-http-response": "0.2.2",
Expand Down
Loading

0 comments on commit 04e842d

Please sign in to comment.