From 5cb2c65146a070d5ecbe1e459858669e598449ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:37:40 +0000 Subject: [PATCH 1/2] fix: shorten multipart boundary sep to less than RFC specificed max length --- lib/increase/internal/util.rb | 3 ++- test/increase/internal/util_test.rb | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/increase/internal/util.rb b/lib/increase/internal/util.rb index acece214d..7dbbd9c03 100644 --- a/lib/increase/internal/util.rb +++ b/lib/increase/internal/util.rb @@ -566,7 +566,8 @@ class << self # # @return [Array(String, Enumerable)] private def encode_multipart_streaming(body) - boundary = SecureRandom.urlsafe_base64(60) + # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length + boundary = SecureRandom.urlsafe_base64(46) closing = [] strio = writable_enum do |y| diff --git a/test/increase/internal/util_test.rb b/test/increase/internal/util_test.rb index 852f13cc9..fb5434203 100644 --- a/test/increase/internal/util_test.rb +++ b/test/increase/internal/util_test.rb @@ -213,6 +213,18 @@ def env_table end end + def test_encoding_length + headers, = Increase::Internal::Util.encode_content( + {"content-type" => "multipart/form-data"}, + Pathname(__FILE__) + ) + assert_pattern do + headers.fetch("content-type") => /boundary=(.+)$/ + end + field, = Regexp.last_match.captures + assert(field.length < 70 - 6) + end + def test_file_encode file = Pathname(__FILE__) headers = {"content-type" => "multipart/form-data"} From 8ff3bd6be245ff79327fc2f1e134cbe3972672cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:38:01 +0000 Subject: [PATCH 2/2] release: 1.91.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/increase/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f18270d52..bdd1880da 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.91.0" + ".": "1.91.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4df261628..7af5961e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.91.1 (2025-09-26) + +Full Changelog: [v1.91.0...v1.91.1](https://github.com/Increase/increase-ruby/compare/v1.91.0...v1.91.1) + +### Bug Fixes + +* shorten multipart boundary sep to less than RFC specificed max length ([5cb2c65](https://github.com/Increase/increase-ruby/commit/5cb2c65146a070d5ecbe1e459858669e598449ad)) + ## 1.91.0 (2025-09-26) Full Changelog: [v1.90.0...v1.91.0](https://github.com/Increase/increase-ruby/compare/v1.90.0...v1.91.0) diff --git a/Gemfile.lock b/Gemfile.lock index 90c6a124a..c7172b3e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - increase (1.91.0) + increase (1.91.1) connection_pool GEM diff --git a/README.md b/README.md index 053858432..976db60e5 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "increase", "~> 1.91.0" +gem "increase", "~> 1.91.1" ``` diff --git a/lib/increase/version.rb b/lib/increase/version.rb index 819a213d6..2291ed6ec 100644 --- a/lib/increase/version.rb +++ b/lib/increase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Increase - VERSION = "1.91.0" + VERSION = "1.91.1" end