1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-06-17 22:37:33 +02:00
Commit Graph

75 Commits

Author SHA1 Message Date
2584f689c6 Fix X-Origin-Content-Length header value when SVG is sanitized or minified 2025-04-29 21:28:50 +03:00
528ece8da1 Revised errors for better error reporting 2025-02-17 22:11:40 +03:00
90e5f19a6e Rename IMGPROXY_ENABLE_*_DETECTION configs to IMGPROXY_AUTO_* 2024-12-08 19:26:58 +03:00
ba17ed8f19 Add imgproxy.source_image_url and imgproxy.processing_options attributes to New Relic, DataDog, and OpenTelemetry traces 2024-08-23 18:46:46 +03:00
e867d0f10a Add write response timeout 2024-06-03 20:26:10 +03:00
68d38949d8 Replace semaphore implementation with golang.org/x/sync/semaphore 2024-05-30 18:02:12 +03:00
923b32a1b4 feat: Implement AlwaysRasterizeSvg (#1257)
Implement AlwaysRasterizeSvg
Add sanitize to skip processing
Add tests
Refactoring skipProcessing
2024-03-25 20:53:43 +06:00
71aea9b507 Add processing options and source image URL to error reports 2024-03-10 20:44:45 +03:00
04d65a220b Don't set Expires HTTP header 2023-12-04 20:31:05 +03:00
79e6b32c9c Allow IMGPROXY_TTL to be zero 2023-12-04 19:42:07 +03:00
3fe820625d Revised downloading errors reporting 2023-12-03 21:00:20 +03:00
be31a2e0f6 Fix typo 2023-11-13 20:36:10 +03:00
16571e1360 fix typo 2023-11-13 23:30:09 +06:00
07e34a45f2 Rename concurrency to workers 2023-08-15 21:05:55 +03:00
fd2566a489 Fix IMGPROXY_CACHE_CONTROL_PASSTHROUGH + IMGPROXY_FALLBACK_IMAGE_TTL behavior 2023-07-25 18:58:05 +03:00
94492e812c Don't report context cancelled errors to metrics collectors 2023-07-19 16:43:30 +03:00
4de9b83899 fix(svg/sanitize): preserve headers from origin data 2023-07-04 18:34:18 +03:00
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
c98752651a Don't set Content-DPR header 2023-04-18 18:40:23 +03:00
b92de43cf3 Add support for client hints prefixed with Sec-CH-; Remove Viewport-Width header support 2023-04-11 21:08:39 +03:00
1a9768a2c6 Prohibit connecting to loopback, link-local multicast, and link-local unicast IP addresses by default 2023-03-22 20:25:51 +03:00
24f4d43a0f use "clean" HTTP transport; Use context for downloading timeout control 2023-03-21 20:58:16 +03:00
51aa219315 Add Accept to the Vary header if AVIF detection is enabled 2023-03-09 18:08:08 +03:00
50d04d585e Make the expires option set Expires and Cache-Control headers 2023-02-24 19:44:03 +03:00
aa80dc022f Move download options to imagedata.DownloadOptions 2023-02-23 21:39:52 +03:00
9416168575 Security processing options 2023-02-23 21:11:44 +03:00
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
4ab415fd9b Fix feDropShadow SVG filter when IMGPROXY_SVG_FIX_UNSUPPORTED is true 2022-10-15 20:22:54 +06:00
f5f4fb6487 Borrow buffer from imagedata pool when sanitizing SVG 2022-10-15 19:31:04 +06:00
0dc16ba76b Fix path before signature check 2022-09-15 22:36:47 +06:00
30f744e116 Try to fix path if signature is invalid 2022-09-15 22:12:16 +06:00
0f7281e56e raw processing option 2022-09-07 18:03:12 +06:00
cf2b3c5195 requests/images in progress stats and queue time metric 2022-07-26 14:35:49 +06:00
9081fd5766 IMGPROXY_REQUESTS_QUEUE_SIZE config 2022-07-20 19:46:21 +06:00
526724105e Proper semaphore 2022-07-20 18:06:26 +06:00
20039f49a5 Better error metrics 2022-07-20 16:09:07 +06:00
e1e2277a32 Sanitize SVG 2022-06-10 18:23:55 +06:00
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
91a3671f9d Add X-Result-Width and X-Result-Height to debug headers 2022-04-18 16:45:34 +06:00
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
b5863c808b Move metrics.StartRequest to middleware && Fix Datadog 2022-01-14 00:40:14 +06:00
e43c24c544 Start requiest timer in router 2022-01-14 00:18:48 +06:00
d8bedfd930 Polish cookies passthrough 2021-11-11 15:30:32 +06:00
abbfb61ce6 Add option to pass through incoming cookies in the image request. 2021-11-09 12:14:05 +01:00
d8dae48c4f Report downloading errors only when IMGPROXY_REPORT_DOWNLOADING_ERRORS is true 2021-11-01 20:03:19 +06:00
b98919ead4 Better downloading error reporting cause 2021-11-01 18:29:26 +06:00
ac8c34a49a Respond with 500 for "temporary" downloading errors 2021-11-01 18:13:33 +06:00
80331cd94e Add cache control headers to 304 response 2021-10-13 17:59:46 +06:00
38ca14230d Add origin width & height to debug headers 2021-10-12 16:56:04 +06:00
da10f3eac3 Fix Client Hints behavior 2021-10-12 16:56:03 +06:00