Skip to content

fix(run): Update sinatra so it is compatible with Ruby 4.0#1835

Merged
iennae merged 1 commit into
GoogleCloudPlatform:mainfrom
amcolin:add-missing-ostruct-gem
Jun 12, 2026
Merged

fix(run): Update sinatra so it is compatible with Ruby 4.0#1835
iennae merged 1 commit into
GoogleCloudPlatform:mainfrom
amcolin:add-missing-ostruct-gem

Conversation

@amcolin

@amcolin amcolin commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates the helloworld app for Ruby 4.0 compatibility, which also required an upgrade to Sinatra.

Sinatra 4.1+ now defaults to the Rack::Protection::HostAuthorization middleware. This triggered 403 Forbidden ("Host not permitted") errors across deployed Cloud Run services and E2E tests, as the application began strictly blocking any Host headers other than localhost, So now the code it explicitly says which domains are allowed.

Fixes Internal b/522468963

Checklist

  • Tests pass
  • Lint pass: bundle exec rubocop
  • Please merge this PR for me once it is approved.

@product-auto-label product-auto-label Bot added api: run Issues related to the Cloud Run API. samples Issues that are directly related to samples. labels Jun 11, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the ostruct gem to the Gemfile and Gemfile.lock. The reviewer pointed out that this dependency is currently unused in the application and recommended removing it, or using Struct or Data instead due to the performance overhead and deprecation of OpenStruct in modern Ruby.

Comment thread run/helloworld/Gemfile Outdated
@amcolin amcolin force-pushed the add-missing-ostruct-gem branch 7 times, most recently from 3c31a8b to 0e97e31 Compare June 12, 2026 19:25
@amcolin amcolin changed the title fix(run): Add missing ostruct gem fix(run): Update sinatra so it is compatible with Ruby 4.0 Jun 12, 2026
@amcolin amcolin force-pushed the add-missing-ostruct-gem branch from 0e97e31 to 0d85be7 Compare June 12, 2026 19:34
@amcolin amcolin force-pushed the add-missing-ostruct-gem branch from 0d85be7 to db9e0b6 Compare June 12, 2026 19:35
@amcolin amcolin marked this pull request as ready for review June 12, 2026 20:12
@amcolin amcolin requested review from a team as code owners June 12, 2026 20:12
@iennae iennae merged commit 881a669 into GoogleCloudPlatform:main Jun 12, 2026
9 checks passed
@amcolin amcolin deleted the add-missing-ostruct-gem branch June 12, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: run Issues related to the Cloud Run API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants