-
In writer for example gzip, there is a size value indicating the uncompressed size. However, in situation like building a gzip middleware, the compressed size is also important for the Content-Length header. I struggled for a while to find the way to get the size, but failed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@slhmy The gzip size is 32 bits, so it wraps at 4GB. Also you can append separate gzip files in which case you need to read each (and you can really find each without decoding)- so in practical terms it is not that useful. It is the final 4 bytes of the gzip stored in little endian. gzhttp removes Content-Size instead, since it will do streaming writes. |
Beta Was this translation helpful? Give feedback.
@slhmy The gzip size is 32 bits, so it wraps at 4GB. Also you can append separate gzip files in which case you need to read each (and you can really find each without decoding)- so in practical terms it is not that useful.
It is the final 4 bytes of the gzip stored in little endian.
gzhttp removes Content-Size instead, since it will do streaming writes.