• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 29200085335 / 16
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 12 Jul 2026 04:27PM UTC
Files 167
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jul 2026 04:24PM UTC coverage: 95.226% (+0.005%) from 95.221%
29200085335.16

push

github

web-flow
Don't mutate router maps at request time (#2790)

Grape::Router built @map and @optimized_map as auto-vivifying hashes
(Hash.new { |h, k| h[k] = ... }). compile! only fills keys for HTTP
methods that have routes, but at request time #match? and #rotation look
the maps up by the request's method, so any method with no routes inserted
a key into the shared hashes. The router is frozen only shallowly, so the
inner hashes stayed mutable.

That is a data race on runtimes without a GVL (JRuby, TruffleRuby), where
concurrent Hash#[]= corrupts the hash, and unbounded growth everywhere:
each distinct method string becomes a permanent key, so a client sending
arbitrary methods grows the maps without limit.

Use plain hashes, create the array explicitly on append, freeze both maps
after compile!, and read missing keys without inserting (#match? via safe
navigation, #rotation via &.each). Requests with an unrouted method still
resolve to 404/405 exactly as before.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

1104 of 1222 branches covered (90.34%)

Branch coverage included in aggregate %.

3544 of 3659 relevant lines covered (96.86%)

964.31 hits per line

Source Files on job run-4.0-gemfiles/rails_7_2.gemfile - 29200085335.16
  • Tree
  • List 167
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 29200085335
  • c8417f21 on github
  • Prev Job for on master (#29198375214.23)
  • Next Job for on master (#29200240078.32)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc