diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 396d9f0..3d5f4e3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.4.1" + ".": "4.5.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 63354d3..47cf1d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 4.5.0 (2026-04-28) + +Full Changelog: [v4.4.1...v4.5.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.4.1...v4.5.0) + +### Features + +* support setting headers via env ([cd32783](https://github.com/imagekit-developer/imagekit-ruby/commit/cd32783efe49d795b8a5de49eb44039cda375d2e)) + + +### Chores + +* **internal:** codegen related update ([7e0543d](https://github.com/imagekit-developer/imagekit-ruby/commit/7e0543d8714ff251de1a32f471dc7bd8bfa17dab)) + ## 4.4.1 (2026-04-24) Full Changelog: [v4.4.0...v4.4.1](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.4.0...v4.4.1) diff --git a/Gemfile.lock b/Gemfile.lock index d8e6b57..088e705 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - imagekitio (4.4.1) + imagekitio (4.5.0) cgi connection_pool standardwebhooks @@ -144,7 +144,7 @@ GEM rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) - standardwebhooks (1.0.1) + standardwebhooks (1.1.0) steep (1.10.0) activesupport (>= 5.1) concurrent-ruby (>= 1.1.10) diff --git a/README.md b/README.md index 8c8e0ba..7a03c78 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "imagekitio", "~> 4.4.1" +gem "imagekitio", "~> 4.5.0" ``` diff --git a/lib/imagekitio/client.rb b/lib/imagekitio/client.rb index dc6d989..b4bfd22 100644 --- a/lib/imagekitio/client.rb +++ b/lib/imagekitio/client.rb @@ -120,6 +120,19 @@ def initialize( raise ArgumentError.new("private_key is required, and can be set via environ: \"IMAGEKIT_PRIVATE_KEY\"") end + headers = {} + custom_headers_env = ENV["IMAGE_KIT_CUSTOM_HEADERS"] + unless custom_headers_env.nil? + parsed = {} + custom_headers_env.split("\n").each do |line| + colon = line.index(":") + unless colon.nil? + parsed[line[0...colon].strip] = line[(colon + 1)..].strip + end + end + headers = parsed.merge(headers) + end + @private_key = private_key.to_s @password = password.to_s @webhook_secret = webhook_secret&.to_s @@ -129,7 +142,8 @@ def initialize( timeout: timeout, max_retries: max_retries, initial_retry_delay: initial_retry_delay, - max_retry_delay: max_retry_delay + max_retry_delay: max_retry_delay, + headers: headers ) @custom_metadata_fields = Imagekitio::Resources::CustomMetadataFields.new(client: self) diff --git a/lib/imagekitio/version.rb b/lib/imagekitio/version.rb index 4f6f300..fd555c9 100644 --- a/lib/imagekitio/version.rb +++ b/lib/imagekitio/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Imagekitio - VERSION = "4.4.1" + VERSION = "4.5.0" end