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

ruby-grape / grape / 33412721482
97%

Build:
DEFAULT BRANCH: master
Ran 31 Aug 2026 04:11PM UTC
Jobs 32
Files 169
Run time 1min
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

31 Aug 2026 04:11PM UTC coverage: 96.985% (+0.007%) from 96.978%
33412721482

push

github

web-flow
Skip the query parse and the path concatenation in content negotiation (#2875)

`Formatter#negotiate_content_type` runs on every request and reads two things
before it can fall back to the API's declared format:

    fmt = format_from_extension || query_params['format'] || format || ...

`query_params` is `Rack::Request#GET`, so a request with no query string at all
still parsed one. And `format_from_extension` read `rack_request.path`, which is
`script_name + path_info` — a String built to be scanned once for a dot and
thrown away.

Both are now skipped in the common case. `?format=` cannot be present without a
query string, so an empty QUERY_STRING returns early. And the extension is the
tail of the path, so PATH_INFO answers it on its own whenever there is one: a
dot in SCRIPT_NAME is followed by the slash that opens PATH_INFO, and no
registered extension holds a slash. Only an empty PATH_INFO needs the
concatenation.

Measured in one process:

    rack_request.path        97 ns  ->  env[PATH_INFO]           39 ns   2.5x

and three fewer objects allocated per request on a bare JSON GET (46.1 -> 43.1),
counted deterministically end to end.

Both guards test `nil?`/`empty?` rather than `blank?` on purpose: neither value
has been scrubbed at this point, and `String#blank?` runs a regexp, which raises
on an invalid byte sequence — the case `formatter_spec.rb` covers with
`"/info.\x80"`.

Content negotiation is unchanged. Extension, `?format=`, declared format, Accept
header and default still resolve in that order, and a 21-case diff of responses
(extension, query, Accept casing, `*/*`, SCRIPT_NAME with a dot, empty
PATH_INFO, 204/404/405/406) is byte-identical to master.

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

1238 of 1330 branches covered (93.08%)

Branch coverage included in aggregate %.

10 of 10 new or added lines in 1 file covered. (100.0%)

3908 of 3976 relevant lines covered (98.29%)

27279.13 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/rails_8_0.gemfile - 33412721482.1 31 Aug 2026 04:12PM UTC 169
95.74
GitHub Action Run
2 run-3.3-Gemfile - 33412721482.2 31 Aug 2026 04:12PM UTC 168
95.74
GitHub Action Run
3 run-4.0-Gemfile - 33412721482.3 31 Aug 2026 04:11PM UTC 168
95.74
GitHub Action Run
4 run-3.4-gemfiles/rails_8_0.gemfile - 33412721482.4 31 Aug 2026 04:11PM UTC 169
95.74
GitHub Action Run
5 run-4.0-gemfiles/rack_3_1.gemfile - 33412721482.5 31 Aug 2026 04:12PM UTC 168
95.74
GitHub Action Run
6 run-4.0-gemfiles/multi_json.gemfile - 33412721482.6 31 Aug 2026 04:11PM UTC 168
47.49
GitHub Action Run
7 run-3.3-gemfiles/rails_7_2.gemfile - 33412721482.7 31 Aug 2026 04:12PM UTC 169
95.74
GitHub Action Run
8 run-3.4-gemfiles/rails_8_1.gemfile - 33412721482.8 31 Aug 2026 04:12PM UTC 169
95.74
GitHub Action Run
9 run-3.3-gemfiles/rack_2_2.gemfile - 33412721482.9 31 Aug 2026 04:11PM UTC 168
95.7
GitHub Action Run
10 run-3.4-gemfiles/rails_7_2.gemfile - 33412721482.10 31 Aug 2026 04:12PM UTC 169
95.74
GitHub Action Run
11 run-3.4-Gemfile - 33412721482.11 31 Aug 2026 04:12PM UTC 168
95.74
GitHub Action Run
12 run-4.0-gemfiles/dry_validation.gemfile - 33412721482.12 31 Aug 2026 04:12PM UTC 168
57.87
GitHub Action Run
13 run-3.3-gemfiles/rails_8_0.gemfile - 33412721482.13 31 Aug 2026 04:11PM UTC 169
95.74
GitHub Action Run
14 run-3.4-gemfiles/rack_2_2.gemfile - 33412721482.14 31 Aug 2026 04:11PM UTC 168
95.7
GitHub Action Run
15 run-4.0-gemfiles/rails_8_1.gemfile - 33412721482.15 31 Aug 2026 04:11PM UTC 169
95.74
GitHub Action Run
16 run-4.0-gemfiles/rails_7_2.gemfile - 33412721482.16 31 Aug 2026 04:11PM UTC 169
95.74
GitHub Action Run
17 run-4.0-gemfiles/hashie.gemfile - 33412721482.17 31 Aug 2026 04:12PM UTC 168
61.75
GitHub Action Run
18 run-3.3-gemfiles/rack_3_0.gemfile - 33412721482.18 31 Aug 2026 04:11PM UTC 168
95.74
GitHub Action Run
19 run-4.0-gemfiles/rack_3_2.gemfile - 33412721482.19 31 Aug 2026 04:12PM UTC 168
95.74
GitHub Action Run
20 run-3.4-gemfiles/rack_3_1.gemfile - 33412721482.20 31 Aug 2026 04:12PM UTC 168
95.74
GitHub Action Run
21 run-3.4-gemfiles/rack_3_0.gemfile - 33412721482.21 31 Aug 2026 04:12PM UTC 168
95.74
GitHub Action Run
22 run-4.0-gemfiles/multi_json_1_20.gemfile - 33412721482.22 31 Aug 2026 04:11PM UTC 168
47.53
GitHub Action Run
23 run-4.0-gemfiles/grape_entity.gemfile - 33412721482.23 31 Aug 2026 04:11PM UTC 168
50.25
GitHub Action Run
24 run-4.0-gemfiles/grape_swagger.gemfile - 33412721482.24 31 Aug 2026 04:11PM UTC 168
55.23
GitHub Action Run
25 run-4.0-gemfiles/multi_xml_0_8.gemfile - 33412721482.25 31 Aug 2026 04:11PM UTC 168
46.92
GitHub Action Run
26 run-3.4-gemfiles/rack_3_2.gemfile - 33412721482.26 31 Aug 2026 04:11PM UTC 168
95.74
GitHub Action Run
27 run-3.3-gemfiles/rails_8_1.gemfile - 33412721482.27 31 Aug 2026 04:11PM UTC 169
95.74
GitHub Action Run
28 run-3.3-gemfiles/rack_3_1.gemfile - 33412721482.28 31 Aug 2026 04:11PM UTC 168
95.74
GitHub Action Run
29 run-3.3-gemfiles/rack_3_2.gemfile - 33412721482.29 31 Aug 2026 04:12PM UTC 168
95.74
GitHub Action Run
30 run-4.0-gemfiles/multi_xml.gemfile - 33412721482.30 31 Aug 2026 04:11PM UTC 168
46.89
GitHub Action Run
31 run-4.0-gemfiles/rack_2_2.gemfile - 33412721482.31 31 Aug 2026 04:11PM UTC 168
95.7
GitHub Action Run
32 run-4.0-gemfiles/rack_3_0.gemfile - 33412721482.32 31 Aug 2026 04:11PM UTC 168
95.74
GitHub Action Run
Source Files on build 33412721482
  • Tree
  • List 169
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #33412721482
  • 77a26759 on github
  • Prev Build on master (#33365105943)
  • Next Build on master (#33413427296)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc