nftstorage / nftstorage.link

🪐 NFT.Storage Gateway, the IPFS gateway for NFT.Storage is not "another gateway", but a caching layer for NFTs that sits on top of existing IPFS public gateways. ***Notice: Uploads have been decommissioned.**** Learn more and find a new hot storage provider for uploading new assets: nft.storage/nft-storage-classic
https://nft.storage/nft-storage-classic
Other
46 stars 10 forks source link

fix: api permacache validate content length header #98

Closed vasco-santos closed 2 years ago

vasco-santos commented 2 years ago

This PR Validates content length exists on response from gateway, given it is required by R2. If there is no content length, buffers it in memory and adds to R2 the new Response to get the content length

Related to https://github.com/protocol/bifrost-infra/issues/1868

TODO:

cloudflare-pages[bot] commented 2 years ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: e17f833
Status: ✅  Deploy successful!
Preview URL: https://a3328f0d.nftstorage-link.pages.dev

View logs

vasco-santos commented 2 years ago

We decided to move forward with this solution for MVP until we have a way of buffering content in external service or a fix to get content length here.