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

ruby-grape / grape / 32581434646
97%

Build:
DEFAULT BRANCH: master
Ran 22 Aug 2026 03:21PM UTC
Jobs 32
Files 168
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

22 Aug 2026 03:21PM UTC coverage: 96.993% (-0.01%) from 97.006%
32581434646

push

github

web-flow
Tag path params as UTF-8 instead of leaving them binary (#2839)

Mustermann decodes path captures out of PATH_INFO, which Rack hands over
tagged ASCII-8BIT, and nothing re-tagged the result. Query and body params
arrive UTF-8 because Rack tags those itself, so the same value reached the
endpoint with a different encoding depending on where it came from.

That made an API's declarations disagree with themselves -- a binary string
never equals the UTF-8 literal it was written as:

    params { requires :id, type: String, values: ['café'] }

    GET /?id=café   ->  200
    GET /café       ->  400 "id does not have a valid value"

The same held for same_as, except_values and any comparison an endpoint made
against a non-ASCII literal. It also leaked into serialization: a non-ASCII
path param rendered into a JSON response drew an encoding warning from the
json gem, which that gem says will become an error in json 3.0.

Re-tag in Route#params_for, the single funnel for path-extracted values.

Nothing obliges a client to send UTF-8 -- HTTP treats the request target as
octets, and Rack's SPEC has CGI keys carry non-ASCII as ASCII-8BIT -- so
UTF-8 is the convention rather than a guarantee: it is what browsers
percent-encode with, what an IRI maps to, and what Rails settles on
(ActionDispatch::Journey::Router force_encodes every path capture to UTF-8
after unescaping it). Only the encoding changes here: the bytes are
untouched, so octets that are not UTF-8 stay invalid and are still caught
downstream instead of being silently scrubbed into something the client
never sent. Unnamed splats capture into an Array, so those are walked too.

The re-tag is unconditional and in place, hence tag_utf8!. That is safe
rather than merely cheap: Mustermann's Pattern#params builds a fresh Hash of
fresh, unfrozen strings on every call and skips its own Match cache, so the
mutation cannot escape the request. It is also what lets the Array branch
re-tag its elements with each.

S... (continued)

1223 of 1312 branches covered (93.22%)

Branch coverage included in aggregate %.

7 of 8 new or added lines in 1 file covered. (87.5%)

3842 of 3910 relevant lines covered (98.26%)

27160.5 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
96.36
-3.64% lib/grape/router/route.rb
Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/rack_3_1.gemfile - 32581434646.1 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
2 run-3.4-Gemfile - 32581434646.2 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
3 run-3.4-gemfiles/rack_3_2.gemfile - 32581434646.3 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
4 run-4.0-gemfiles/rails_8_1.gemfile - 32581434646.4 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
5 run-3.4-gemfiles/rack_2_2.gemfile - 32581434646.5 22 Aug 2026 03:21PM UTC 167
95.69
GitHub Action Run
6 run-4.0-gemfiles/grape_swagger.gemfile - 32581434646.6 22 Aug 2026 03:21PM UTC 167
55.43
GitHub Action Run
7 run-3.4-gemfiles/rails_8_0.gemfile - 32581434646.7 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
8 run-4.0-gemfiles/multi_xml_0_8.gemfile - 32581434646.8 22 Aug 2026 03:21PM UTC 167
47.09
GitHub Action Run
9 run-3.3-gemfiles/rack_3_1.gemfile - 32581434646.9 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
10 run-3.3-gemfiles/rails_8_1.gemfile - 32581434646.10 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
11 run-4.0-gemfiles/grape_entity.gemfile - 32581434646.11 22 Aug 2026 03:21PM UTC 167
50.27
GitHub Action Run
12 run-3.4-gemfiles/rails_7_2.gemfile - 32581434646.12 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
13 run-3.4-gemfiles/rack_3_0.gemfile - 32581434646.13 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
14 run-3.3-gemfiles/rails_8_0.gemfile - 32581434646.14 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
15 run-4.0-gemfiles/rack_2_2.gemfile - 32581434646.15 22 Aug 2026 03:21PM UTC 167
95.69
GitHub Action Run
16 run-4.0-gemfiles/multi_json.gemfile - 32581434646.16 22 Aug 2026 03:21PM UTC 167
47.62
GitHub Action Run
17 run-4.0-gemfiles/multi_json_1_20.gemfile - 32581434646.17 22 Aug 2026 03:21PM UTC 167
47.66
GitHub Action Run
18 run-3.4-gemfiles/rack_3_1.gemfile - 32581434646.18 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
19 run-4.0-gemfiles/rails_7_2.gemfile - 32581434646.19 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
20 run-3.3-gemfiles/rack_3_2.gemfile - 32581434646.20 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
21 run-4.0-gemfiles/dry_validation.gemfile - 32581434646.21 22 Aug 2026 03:21PM UTC 167
58.11
GitHub Action Run
22 run-4.0-gemfiles/rails_8_0.gemfile - 32581434646.22 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
23 run-4.0-gemfiles/rack_3_0.gemfile - 32581434646.23 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
24 run-4.0-gemfiles/hashie.gemfile - 32581434646.24 22 Aug 2026 03:21PM UTC 167
62.14
GitHub Action Run
25 run-3.3-gemfiles/rack_2_2.gemfile - 32581434646.25 22 Aug 2026 03:21PM UTC 167
95.69
GitHub Action Run
26 run-4.0-gemfiles/multi_xml.gemfile - 32581434646.26 22 Aug 2026 03:21PM UTC 167
47.05
GitHub Action Run
27 run-3.3-Gemfile - 32581434646.27 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
28 run-3.3-gemfiles/rack_3_0.gemfile - 32581434646.28 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
29 run-3.4-gemfiles/rails_8_1.gemfile - 32581434646.29 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
30 run-4.0-gemfiles/rack_3_2.gemfile - 32581434646.30 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
31 run-3.3-gemfiles/rails_7_2.gemfile - 32581434646.31 22 Aug 2026 03:21PM UTC 168
95.73
GitHub Action Run
32 run-4.0-Gemfile - 32581434646.32 22 Aug 2026 03:21PM UTC 167
95.72
GitHub Action Run
Source Files on build 32581434646
  • Tree
  • List 168
  • 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 #32581434646
  • a151398b on github
  • Prev Build on master (#32467741741)
  • Next Build on master (#32582889873)
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