Although S3 offers a GetObjectTorrent API call to generate a torrent
file on their end, it doesn't look like any similar systems with S3
compatible APIs actually support it. Notably, Minio and Wasabi do not.
In order to remain compatible with these, it's better to not rely on the
storage backend to handle creation.
* Bail out on files that are too large earlier if possible.
* Return 400 instead of 500 for empty files and files that are too large
(when we can bail out early).
This new backend currently isn't hooked up; new and existing installs
will continue to use the localfs backend.
* Rework torrent generation to be backend-dependent so we can use S3's
existing torrent API.
* Remove the torrent test cases, which broke with this torrent rework;
they will need to be added back later.
* Use `http.MaxBytesReader` for better max size handling.
* Allow backends to return errors in `ServeFile` if needed.
Use of the Content-Security-Policy header to specify a referrer policy
was deprecated in favor of a [new
header](fc55d917be).
This change changes the existing referrer policy directives to use this
header and adds corresponding config options/command line flags.
* Serve file directly for curl and wget user agents
Fix#127
* Add test for get with wget user agent
* Add -nodirectagents flag
to disable serving files directly for wget/curl user agents
* Fix TestPutAndGetCLI failing for Go 1.5
It failed because it doesn't include the Content-Type header for every
response.
When running under docker-compose the volume changes the permissions by default to root but its avoided if the directory where it is mounted is created first with the correct owner.
Previously, we did not properly handle the case where the provided
expiry was zero and the max expiry was configured to be nonzero; add an
additional check to cover this case.
Fixes#111.