grab icon indicating copy to clipboard operation
grab copied to clipboard

add reader middleware for processing response body data before save

Open hbakhtiyor opened this issue 6 years ago • 3 comments

maybe you have another idea to achieve this, i need to decrypt body data before saving to file https://github.com/hbakhtiyor/gt/blob/fs/gt/fsend/download.go#L45-L59

hbakhtiyor avatar Jan 04 '19 16:01 hbakhtiyor

This is really cool. I like this idea. We'll need to consider what happens if the given Reader returns a different byte count than has been returned by the remote server. This will affect other features and checks. Do you have any thoughts about this?

cavaliercoder avatar Jan 06 '19 06:01 cavaliercoder

here's version using the patch https://github.com/hbakhtiyor/gt/blob/fs/gt/cli/cli.go#L279-L288 here's the reader https://github.com/hbakhtiyor/openssl_gcm/blob/master/gcm_encrypt_reader.go#L38

yeah, stats is a bit messy, only downloaded bytes 2762815 and speed are correct

Downloading filename 2762815 / -1 bytes (-276281500%) - 112.00KBp/s ETA: -24s

the reader only reads bytes which indicated buf size in grab itself,

hbakhtiyor avatar Jan 07 '19 06:01 hbakhtiyor

Similar (but different) to #57.

cavaliercoder avatar Feb 28 '19 05:02 cavaliercoder