Skip to content

Fix standalone URL-safe Base64 decoding - #195

Open
OskarEichler wants to merge 1 commit into
igrigorik:mainfrom
OskarEichler:audit/fix-standalone-base64
Open

Fix standalone URL-safe Base64 decoding#195
OskarEichler wants to merge 1 commit into
igrigorik:mainfrom
OskarEichler:audit/fix-standalone-base64

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

  • define urlsafe_decode64 on the fallback HTTP2::Base64 module
  • keep the Ruby 3.3+ no-stdlib fallback self-contained
  • restore h2c server upgrade when no other dependency preloads ::Base64

Reproduction

On Ruby 4 with gems disabled, requiring http/2/base64 defines HTTP2::Base64.urlsafe_encode64 but not its decoder. HTTP2::Server#upgrade therefore raises NoMethodError unless something else happened to load the standalone base64 gem.

Verification

  • 448 examples, 0 failures on Ruby 4.0.6
  • clean --disable=gems URL-safe binary round-trip
  • bodyless h2c upgrade model
  • all 18 runtime files pass syntax checks
  • RuboCop passes the runtime source

No repository tests were changed. I used an AI coding assistant during investigation and verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant