Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fjmorel
Copy link
Contributor

@fjmorel fjmorel commented Dec 5, 2025

Use lowercase headers to resolve errors due to rack/rack#1592 after upgrading Rack.

@sshaw
Copy link
Owner

sshaw commented Dec 5, 2025

Thanks for this. Glad to see this middleware is used. Heh. Please share your use case if you can.

CI failures are unrelated.

In Rack 3 what happens when a header is not lowercase?

@sshaw sshaw merged commit 41aae4f into sshaw:master Dec 5, 2025
0 of 7 checks passed
@fjmorel
Copy link
Contributor Author

fjmorel commented Dec 5, 2025

I love this project! It handles converting everything the labels give us from XML to JSON. It's much easier to work with after that, even if we have to look in multiple places for info based on the version and partner.

In the (default) development environment, you get a 500 with this in the logs:

Rack::Lint::LintError: uppercase character in header name: Content-Type (Rack::Lint::LintError)
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rack-3.2.4/lib/rack/lint.rb:729:in 'block in Rack::Lint::Wrapper#check_headers'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rack-3.2.4/lib/rack/lint.rb:714:in 'Hash#each'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rack-3.2.4/lib/rack/lint.rb:714:in 'Rack::Lint::Wrapper#check_headers'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rack-3.2.4/lib/rack/lint.rb:104:in 'Rack::Lint::Wrapper#response'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rack-3.2.4/lib/rack/lint.rb:16:in 'Rack::Lint#call'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rack-3.2.4/lib/rack/show_exceptions.rb:31:in 'Rack::ShowExceptions#call'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rack-3.2.4/lib/rack/common_logger.rb:43:in 'Rack::CommonLogger#call'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rack-3.2.4/lib/rack/content_length.rb:20:in 'Rack::ContentLength#call'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rackup-2.3.1/lib/rackup/handler/webrick.rb:145:in 'Rackup::Handler::WEBrick#service'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rackup-2.3.1/lib/rackup/handler/webrick.rb:28:in 'Rackup::Handler::WEBrick::Server#service'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/webrick-1.9.2/lib/webrick/httpserver.rb:96:in 'WEBrick::HTTPServer#run'
        /home/fmore/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/webrick-1.9.2/lib/webrick/server.rb:309:in 'block in WEBrick::GenericServer#start_thread'
127.0.0.1 - - [05/Dec/2025:18:33:13 -0500] "POST / HTTP/1.1" 500 45514 0.3163

In deployment mode, though, it works fine.

127.0.0.1 - - [05/Dec/2025:18:33:56 -0500] "POST / HTTP/1.1" 200 - 0.2983

@sshaw
Copy link
Owner

sshaw commented Dec 6, 2025

Thanks for the info.

Hurmm you're runnin' on 3.4. Did you have to make dependency tweaks to get ROXML to work? I just added some to master in 6d31f8e and will be making a release shortly.

@fjmorel fjmorel deleted the rack-lowercase-headers branch December 7, 2025 16:38
@fjmorel
Copy link
Contributor Author

fjmorel commented Dec 7, 2025

I don't know much about Ruby. It's mostly Dependabot keeping this service up to date for us now.

Here's my config.ru:

require "rack/ddex"

# https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
run Rack::DDEX.new

and Gemfile:

source 'https://rubygems.org'

gem "rexml"
gem "rackup"
gem "rack", "~> 3.2"
gem "webrick", "~> 1.9"
gem "ddex"

and it's run with

bundle exec rackup --port 9292 --host 0.0.0.0 -I ddex/lib config.ru -E deployment

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.

2 participants