Skip to content

[ruby] return body with headers on / weblog endpoint#6307

Merged
Strech merged 12 commits intomainfrom
romain.marcadier/APPSEC-61286/ruby-weblog-headers
Feb 18, 2026
Merged

[ruby] return body with headers on / weblog endpoint#6307
Strech merged 12 commits intomainfrom
romain.marcadier/APPSEC-61286/ruby-weblog-headers

Conversation

@RomainMuller
Copy link
Contributor

Summary

Update all 11 Ruby weblog variants to return "Hello world!\n" with explicit Content-Type: text/plain and Content-Length: 13 headers from the / endpoint, matching the updated weblog specification.

Variants fixed

sinatra14, sinatra22, sinatra32, sinatra41, rack, rails42, rails52, rails61, rails72, rails80, graphql23

Previously had "Hello, world!" (comma, no \n), rack had "Hello, wat is love?".

christophe-papazian and others added 10 commits February 13, 2026 11:16
JJ-Change-Id: wkrxvy
…` on `/`

Update all Ruby weblog variants to return `"Hello world!\n"` with
explicit `Content-Type: text/plain` and `Content-Length: 13` headers
from the `/` endpoint, matching the updated weblog specification.

Variants fixed: `sinatra14`, `sinatra22`, `sinatra32`, `sinatra41`,
`rack`, `rails42`, `rails52`, `rails61`, `rails72`, `rails80`,
`graphql23`.

JJ-Change-Id: lskotw
@RomainMuller RomainMuller requested review from a team as code owners February 13, 2026 14:39
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72ae4b9ec0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 34 to 37
get '/' do
'Hello, world!'
content_type 'text/plain'
headers 'Content-Length' => '13'
"Hello world!\n"

Choose a reason for hiding this comment

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

P1 Badge Update Sinatra POST / to match root response contract

This change updates only get '/' in the Sinatra weblogs, while post '/' in the same apps still returns 'Hello, world!' without the new text/plain and Content-Length: 13 headers. Because the / endpoint contract applies to both GET and POST, POST requests for sinatra14/22/32/41 remain out of spec and can still fail endpoint validation for Ruby weblog variants.

Useful? React with 👍 / 👎.

@RomainMuller RomainMuller changed the title fix(ruby weblog): return body with headers on / endpoint [ruby] return body with headers on / weblog endpoint Feb 13, 2026
@github-actions
Copy link
Contributor

CODEOWNERS have been resolved as:

utils/build/docker/ruby/graphql23/app/controllers/system_test_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rack/config.ru                                  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails42/app/controllers/system_test_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails52/app/controllers/system_test_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails61/app/controllers/system_test_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails72/app/controllers/system_test_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails80/app/controllers/system_test_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/sinatra14/app.rb                                @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/sinatra22/app.rb                                @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/sinatra32/app.rb                                @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/sinatra41/app.rb                                @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core

Base automatically changed from romain.marcadier/APPSEC-61286/go-weblog-headers to christophe-papazian/test_content_type February 13, 2026 15:44
@RomainMuller RomainMuller requested a review from a team as a code owner February 13, 2026 15:44
An error occurred while trying to automatically change base from romain.marcadier/APPSEC-61286/go-weblog-headers to christophe-papazian/test_content_type February 13, 2026 15:44
Base automatically changed from christophe-papazian/test_content_type to main February 13, 2026 19:33
@RomainMuller RomainMuller requested review from a team as code owners February 13, 2026 19:33
@RomainMuller RomainMuller requested a review from a team as a code owner February 13, 2026 19:33
@RomainMuller RomainMuller requested review from Anilm3, claponcet, jandro996, manuel-alvarez-alvarez, quinna-h and taegyunkim and removed request for a team February 13, 2026 19:33
@Strech
Copy link
Member

Strech commented Feb 16, 2026

@codex verify that changes for content-type and content-length are needed in case of Rails, Sinatra and Rack here.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 584deffb5f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 32 to 35
get '/' do
'Hello, world!'
content_type 'text/plain'
headers 'Content-Length' => '13'
"Hello world!\n"

Choose a reason for hiding this comment

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

P1 Badge Align Sinatra POST / with the updated root response

This change updates only get '/', but Sinatra defines a separate post '/' handler that still returns 'Hello, world!' and does not set the new headers. As a result, POST requests to / in Sinatra variants still violate the updated root contract (Hello world!\n plus Content-Type/Content-Length), so checks that exercise POST / will fail even though GET / now passes.

Useful? React with 👍 / 👎.

Copy link
Member

@Strech Strech left a comment

Choose a reason for hiding this comment

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

I will block it because Rails and Sinatra auto-add headers, we will work on it

@y9v y9v requested a review from Strech February 17, 2026 16:04
@Strech Strech merged commit 0d270e1 into main Feb 18, 2026
529 checks passed
@Strech Strech deleted the romain.marcadier/APPSEC-61286/ruby-weblog-headers branch February 18, 2026 08:33
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.

5 participants

Comments