1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-02-12 11:46:10 +02:00

16 Commits

Author SHA1 Message Date
DarthSim
bf8a39821b Add IMGPROXY_SOURCE_URL_QUERY_SEPARATOR config 2025-01-07 20:48:05 +03:00
DarthSim
d931285ac2 Fix linter warnings 2024-10-02 23:43:24 +03:00
DarthSim
c01158977c Fix treating percent-encoded symbols in s3://, gcs://, abs://, and swift:// URLs 2024-06-11 19:15:55 +03:00
DarthSim
e31b24931d Update linter and fix linting errors 2024-04-18 21:16:32 +03:00
DarthSim
095f56a5b1 Check bucket name and object key in S3, GCS, ABS, and Swift integrations 2024-03-25 18:39:33 +03:00
DarthSim
3b252b83e4 Use custom HTTP client with Azure; Fix Azure transport tests 2024-02-22 20:46:15 +03:00
Ewan Higgs
4944dfab30
Support Last-Modified response header and support If-Modified-Since request header. (#1147)
* Always return Last-Modified and support If-Modified-Since.

* IMGPROXY_USE_LAST_MODIFIED config setting.

IMGPROXY_USE_LAST_MODIFIED  (default false) when enabled will return the
Last-Modified time of the upstream image and also allow the support of
the If-Modified-Since request header (returning a 304 if the image
hasn't been modified).

If-Modified-Since allows If-None-Match to take precedence.

* Fixes based on DarthSim's feedback.

1. Don't worry about nil maps.
2. Fix a test now that we use the config.LastModifiedEnabled (and move
   it's location it he test file to a more sane place).
3. Update GCS transport code based on the refactoring of DarthSim.

In this iteration, we pull the Updated time from the GCS object attributes
and format them as a string. We then parse it in the notmodified module.
Seems a bit silly to do it this way. If we agree on the approach here,
then AWS and Azure can follow.

* Support azure, fs, s3, and swift.

* Grab the headers for If-Modified-Since and Last-Modified before parsing them.

* Add tests for last-modified for fs.

* Support Last-Modified being passed when streaming an upstream file.

* Tests for Last-Modified for GCS and Azure

* Support s3 and swift tests. Sadly fakes3 doesn't support Last-Modified

* Test against forked gofakes3
2023-05-03 21:21:46 +06:00
DarthSim
6d087712aa Remove ctxreader. It didn't solve the problem it meant to solve but it adds unneeded complexity 2023-05-01 20:50:42 +03:00
DarthSim
49e5eb063c Refactor ETag checking in transports 2023-04-10 20:01:44 +03:00
DarthSim
894cb55cbe Polish Azure Blob Storage support 2022-12-15 21:04:47 +06:00
Alan Brault
0b9577eb79
Implement Azure Identity Authentication for Azure Transport (#1052)
* refactor: implement support for azure managed identities and service principals

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* task: implement ranged request support

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* refactor: check result.ETag for nil

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* refactor: implement null guards for content-length and content-type

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* refactor: use blockblob.CountToEnd instead of -1 for length

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* Replace OTel AWS ECS detector with fixed fork

* Update semconv in OTel

* refactor: implement support for azure managed identities and service principals

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* task: implement ranged request support

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* refactor: check result.ETag for nil

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* refactor: implement null guards for content-length and content-type

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* refactor: use blockblob.CountToEnd instead of -1 for length

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* chore: run go mod tidy

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

* refactor: discard err returns

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>

Signed-off-by: Alan Brault <alan.brault@hardwareandtools.com>
Co-authored-by: DarthSim <darthsim@gmail.com>
2022-12-15 18:51:07 +06:00
DarthSim
58fd025f89 Add ranged requests suport to transports 2022-09-07 18:03:12 +06:00
DarthSim
3a79a48d6f Tests and minor fixes for transports 2022-04-07 23:32:51 +06:00
DarthSim
7709b74a5e Bump version 2021-09-30 20:23:30 +06:00
DarthSim
57c314b1f5 Etag passthough 2021-09-29 16:23:54 +06:00
DarthSim
2ea1466d96 Global refactoring 2021-05-07 17:10:21 +06:00