1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-29 08:22:11 +02:00
Commit Graph

16 Commits

Author SHA1 Message Date
DarthSim
93063787b1 Add svg package tests 2023-07-04 18:34:18 +03:00
Andrei Vydrin
4de9b83899 fix(svg/sanitize): preserve headers from origin data 2023-07-04 18:34:18 +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
1a9768a2c6 Prohibit connecting to loopback, link-local multicast, and link-local unicast IP addresses by default 2023-03-22 20:25:51 +03:00
DarthSim
e719c9d39b Get rid of io/ioutil usage 2022-10-28 21:15:13 +06:00
DarthSim
f5f4fb6487 Borrow buffer from imagedata pool when sanitizing SVG 2022-10-15 19:31:04 +06:00
DarthSim
d610afb48b Use require instead of assert in tests 2022-07-18 19:48:50 +06:00
DarthSim
e1e2277a32 Sanitize SVG 2022-06-10 18:23:55 +06:00
DarthSim
9b5001c219 Disable logs in processhing_handler_test 2022-04-07 14:14:44 +06:00
DarthSim
749d29bf44 Stabilize etag tests 2021-09-30 22:00:28 +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
d016e26e2e Merge branch 'master' into version/3 2021-09-07 19:04:33 +06:00
DarthSim
b8ae4640e8 Fix tests compatibility with go < 1.16 2021-05-18 16:06:52 +06:00
DarthSim
0af4720cfa Use imagetype and config in imagemeta 2021-05-13 20:39:13 +06:00
DarthSim
2ea1466d96 Global refactoring 2021-05-07 17:10:21 +06:00