[rgw] GET <object>?torrent returns object's body instead torrent-file
i use awscli:
aws --endpoint-url=http://my-domain.ru s3api get-object-torrent --bucket my-bucket --key test.png test.torrent
and i get object test.png instead torrent-file.
in rgw log(debug rgw = 20) i didn't see any errors or exceptions.
torrent relative parameters:
"rgw_torrent_comment": "", "rgw_torrent_createby": "", "rgw_torrent_encoding": "", "rgw_torrent_flag": "true", "rgw_torrent_origin": "", "rgw_torrent_sha_unit": "524288", "rgw_torrent_tracker": "",
#1 Updated by Robin Johnson 10 months ago
Brief debugging because I saw similar as well, and I think this behavior would be an improvement:
0. If rgw_torrent_flag==FALSE, we should always return an error.
1. If the object was uploaded with rgw_torrent_flag==TRUE, and rgw_torrent_flag then the torrent should be returned.
2. If the object was uploaded with rgw_torrent_flag==FALSE, then we should return an error.
#3 Updated by Casey Bodley 9 months ago
Thanks Robin. My recollection is that we just didn't want to do the SHA calculation and omap request for every upload by default, so the flag was added to control that. So I propose that rgw_torrent_flag be interpreted only as 'generate the SHA/torrent info on object upload', and allow GET ?torrent requests to read any object that has torrent info.