filecoin-saturn / L1-node

Filecoin Saturn L1 Node • The edge cache layer of Filecoin's decentralized CDN 🪐
Other
140 stars 50 forks source link

Write an unclean end to car files on error #397

Closed willscott closed 1 year ago

willscott commented 1 year ago

cc @hannahhoward - i think this is the js equivalent for https://github.com/filecoin-project/lassie/issues/245

guanzo commented 1 year ago

I can confirm that nginx will not cache the response with "unclean end", however the error is not propagated to the client. Likely because nginx ensures a clean end is written.

DiegoRBaquero commented 1 year ago

During my local tests, the client (browser) did get an error when connection was destroyed without proper close.

guanzo commented 1 year ago

My testing was flawed: the browser client does receive errors if the nginx upstream writes an unclean end.

over http2, the chrome error is net::ERR_HTTP2_PROTOCOL_ERROR 200 over https1.1 and plaintext http, the chrome error is net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)

A fetch call will complete without error, but if you try to read the body it'll throw TypeError: Failed to fetch

image