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

69 Commits

Author SHA1 Message Date
Frezyy
923b32a1b4
feat: Implement AlwaysRasterizeSvg (#1257)
Implement AlwaysRasterizeSvg
Add sanitize to skip processing
Add tests
Refactoring skipProcessing
2024-03-25 20:53:43 +06:00
DarthSim
71aea9b507 Add processing options and source image URL to error reports 2024-03-10 20:44:45 +03:00
DarthSim
04d65a220b Don't set Expires HTTP header 2023-12-04 20:31:05 +03:00
DarthSim
79e6b32c9c Allow IMGPROXY_TTL to be zero 2023-12-04 19:42:07 +03:00
DarthSim
3fe820625d Revised downloading errors reporting 2023-12-03 21:00:20 +03:00
DarthSim
be31a2e0f6 Fix typo 2023-11-13 20:36:10 +03:00
Phước Trung
16571e1360 fix typo 2023-11-13 23:30:09 +06:00
DarthSim
07e34a45f2 Rename concurrency to workers 2023-08-15 21:05:55 +03:00
DarthSim
fd2566a489 Fix IMGPROXY_CACHE_CONTROL_PASSTHROUGH + IMGPROXY_FALLBACK_IMAGE_TTL behavior 2023-07-25 18:58:05 +03:00
DarthSim
94492e812c Don't report context cancelled errors to metrics collectors 2023-07-19 16:43:30 +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
c98752651a Don't set Content-DPR header 2023-04-18 18:40:23 +03:00
DarthSim
b92de43cf3 Add support for client hints prefixed with Sec-CH-; Remove Viewport-Width header support 2023-04-11 21:08:39 +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
51aa219315 Add Accept to the Vary header if AVIF detection is enabled 2023-03-09 18:08:08 +03:00
DarthSim
50d04d585e Make the expires option set Expires and Cache-Control headers 2023-02-24 19:44:03 +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
bbb6a3335d Remove all known unsafe attrs from SVG during sanitization; Add Content-Security-Policy header to response 2023-01-11 18:32:21 +03:00
DarthSim
4ab415fd9b Fix feDropShadow SVG filter when IMGPROXY_SVG_FIX_UNSUPPORTED is true 2022-10-15 20:22:54 +06:00
DarthSim
f5f4fb6487 Borrow buffer from imagedata pool when sanitizing SVG 2022-10-15 19:31:04 +06:00
DarthSim
0dc16ba76b Fix path before signature check 2022-09-15 22:36:47 +06:00
DarthSim
30f744e116 Try to fix path if signature is invalid 2022-09-15 22:12:16 +06:00
DarthSim
0f7281e56e raw processing option 2022-09-07 18:03:12 +06:00
DarthSim
cf2b3c5195 requests/images in progress stats and queue time metric 2022-07-26 14:35:49 +06:00
DarthSim
9081fd5766 IMGPROXY_REQUESTS_QUEUE_SIZE config 2022-07-20 19:46:21 +06:00
DarthSim
526724105e Proper semaphore 2022-07-20 18:06:26 +06:00
DarthSim
20039f49a5 Better error metrics 2022-07-20 16:09:07 +06:00
DarthSim
e1e2277a32 Sanitize SVG 2022-06-10 18:23:55 +06:00
Valentine Kiselev
23d0807e46
Add attachment option for Content-Disposition header (#887)
* Add attachment option for Content-Disposition header

Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>

* Add documentation to attachment option

Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>

* Add default attachment option value

Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>

* fix: Add default value to docs

Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>

* fix: Rename option attachment to return_attachment, add ENV-configuration

Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
2022-06-06 14:53:09 +06:00
DarthSim
91a3671f9d Add X-Result-Width and X-Result-Height to debug headers 2022-04-18 16:45:34 +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
DarthSim
b5863c808b Move metrics.StartRequest to middleware && Fix Datadog 2022-01-14 00:40:14 +06:00
DarthSim
e43c24c544 Start requiest timer in router 2022-01-14 00:18:48 +06:00
DarthSim
d8bedfd930 Polish cookies passthrough 2021-11-11 15:30:32 +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
d8dae48c4f Report downloading errors only when IMGPROXY_REPORT_DOWNLOADING_ERRORS is true 2021-11-01 20:03:19 +06: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
38ca14230d Add origin width & height to debug headers 2021-10-12 16:56:04 +06:00
DarthSim
da10f3eac3 Fix Client Hints behavior 2021-10-12 16:56:03 +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
4434f40701 Merge branch 'version/3' into version/3-refactoring 2021-06-28 16:11:33 +06:00
DarthSim
ece4310d70 Merge branch 'master' into version/3 2021-06-28 15:54:02 +06:00
DarthSim
56858a3692 More clear downloading timeout errors; Add image URL to fallback image usage warning 2021-06-28 14:37:25 +06:00
DarthSim
2ea1466d96 Global refactoring 2021-05-07 17:10:21 +06:00