mirror of
https://github.com/rclone/rclone.git
synced 2025-03-16 01:45:20 +08:00

Before this change when NewObject was called the b2 backend would list the directory that the object was in in order to find it. Unfortunately list calls are Class C transactions and cost more. This patch switches to using HEAD requests instead. These are Class B transactions. It is then necessary to parse the headers from response back into the data that we get from the listing. However B2 returns exactly the same data, just in a different form. Rclone will use the old directory listing method when looking for files with versions as these can't be found via a HEAD request. This change will particularly benefit --files-from, rclone serve restic but most operations will see some benefit.