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

29 Commits

Author SHA1 Message Date
DarthSim
07e34a45f2 Rename concurrency to workers 2023-08-15 21:05:55 +03:00
DarthSim
8227592451 Optimize bufpool 2023-06-12 22:00:55 +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
168f6f6043 Retry source image request if http connection was lost 2023-04-16 20:59:48 +03:00
DarthSim
f6f0cbcb4f Fix detection of dead HTTP/2 connections 2023-04-13 23:10:57 +03: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
24f4d43a0f use "clean" HTTP transport; Use context for downloading timeout control 2023-03-21 20:58:16 +03:00
DarthSim
aa80dc022f Move download options to imagedata.DownloadOptions 2023-02-23 21:39:52 +03:00
DarthSim
9416168575 Security processing options 2023-02-23 21:11:44 +03:00
DarthSim
d5d3e32df0 Fix typo in an error message 2023-01-23 18:50:13 +03:00
DarthSim
1ededbb11f Add IMGPROXY_MAX_ANIMATION_FRAME_RESOLUTION config 2022-11-29 18:25:38 +06:00
DarthSim
e719c9d39b Get rid of io/ioutil usage 2022-10-28 21:15:13 +06:00
DarthSim
4e669c8717 Add IMGPROXY_CLIENT_KEEP_ALIVE_TIMEOUT config 2022-10-21 16:40:24 +06:00
DarthSim
f5f4fb6487 Borrow buffer from imagedata pool when sanitizing SVG 2022-10-15 19:31:04 +06:00
DarthSim
0f7281e56e raw processing option 2022-09-07 18:03:12 +06:00
DarthSim
ad5bd69f80 Delayed download buffer grow 2022-08-01 19:48:23 +06:00
Joe Cai
7a2296aee8
Support OpenStack Swift Object Storage (#837)
* Add OpenStack Swift support

* Fix linting errors

* Update CHANGELOG

* Update swift documentation

* Fix linting error

* Swift transport: pass req.Context down, fix parseObjectURL() implementation

* Make swift transport test a test suite

* Use swift://{container}/{object_path} as the source image URL format

* Cleanup

* Swift transport: only close object when returning 304
2022-04-06 17:00:19 +06:00
dcanob
f37d027f4f
add config fallback ttl to avoid default ttl when fallback response (#818)
* add config fallback ttl to avoid default ttl when fallback response

* Update docs/configuration.md

Co-authored-by: Sergey Alexandrovich <DarthSim@users.noreply.github.com>

* move FallbackTTL to loadFallbackImage

* rewrite ifelse

* Update imagedata/image_data.go

don't use config.FallbackTTL on header to get TTL on the response

Co-authored-by: Sergey Alexandrovich <DarthSim@users.noreply.github.com>

* Update processing_handler.go

don't use config.FallbackTTL on header to get TTL on the response

Co-authored-by: Sergey Alexandrovich <DarthSim@users.noreply.github.com>

* rename FallbackTTL to FallbackImageTTL

* Update processing_handler.go

* Fix linter errors

Co-authored-by: Sergey Alexandrovich <DarthSim@users.noreply.github.com>
2022-03-31 13:36:13 +06:00
Sergey Alexandrovich
ec02fc53a5
IMGPROXY_MAX_REDIRECTS config (#797)
* IMGPROXY_MAX_REDIRECTS config

* Apply suggestions from code review

Co-authored-by: Travis-Turner <32389151+Travis-Turner@users.noreply.github.com>

Co-authored-by: Travis-Turner <32389151+Travis-Turner@users.noreply.github.com>
2022-02-16 15:42:09 +06:00
Walter Doerwald
abbfb61ce6 Add option to pass through incoming cookies in the image request. 2021-11-09 12:14:05 +01:00
DarthSim
b98919ead4 Better downloading error reporting cause 2021-11-01 18:29:26 +06:00
DarthSim
ac8c34a49a Respond with 500 for "temporary" downloading errors 2021-11-01 18:13:33 +06:00
DarthSim
80331cd94e Add cache control headers to 304 response 2021-10-13 17:59:46 +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
4434f40701 Merge branch 'version/3' into version/3-refactoring 2021-06-28 16:11:33 +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