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

ruby-grape / grape / 30716593749
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: fix/adversarial-sweep-2026-08
DEFAULT BRANCH: master
Ran 01 Aug 2026 08:16PM UTC
Jobs 32
Files 167
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

01 Aug 2026 08:15PM UTC coverage: 96.964% (-0.01%) from 96.976%
30716593749

Pull #2839

github

ericproulx
Tag path params as UTF-8 instead of leaving them binary

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.

No extra allocations -- the captures are freshly built and unfrozen, so the
re-tag happens in place.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pull Request #2839: Tag path params as UTF-8 instead of leaving them binary

1202 of 1291 branches covered (93.11%)

Branch coverage included in aggregate %.

6 of 7 new or added lines in 1 file covered. (85.71%)

1 existing line in 1 file now uncovered.

3812 of 3880 relevant lines covered (98.25%)

26780.64 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
96.36
-3.64% lib/grape/router/route.rb

Coverage Regressions

Lines Coverage ∆ File
1
96.36
-3.64% lib/grape/router/route.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.4-Gemfile - 30716593749.1 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
2 run-3.3-gemfiles/rack_3_2.gemfile - 30716593749.2 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
3 run-3.4-gemfiles/rails_8_0.gemfile - 30716593749.3 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
4 run-4.0-gemfiles/rails_7_2.gemfile - 30716593749.4 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
5 run-3.3-gemfiles/rack_3_1.gemfile - 30716593749.5 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
6 run-3.4-gemfiles/rack_3_0.gemfile - 30716593749.6 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
7 run-4.0-Gemfile - 30716593749.7 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
8 run-4.0-gemfiles/hashie.gemfile - 30716593749.8 01 Aug 2026 08:16PM UTC 166
61.99
GitHub Action Run
9 run-4.0-gemfiles/multi_xml_0_8.gemfile - 30716593749.9 01 Aug 2026 08:17PM UTC 166
47.16
GitHub Action Run
10 run-3.3-Gemfile - 30716593749.10 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
11 run-3.4-gemfiles/rack_3_1.gemfile - 30716593749.11 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
12 run-3.3-gemfiles/rack_2_2.gemfile - 30716593749.12 01 Aug 2026 08:16PM UTC 166
95.55
GitHub Action Run
13 run-3.4-gemfiles/rails_8_1.gemfile - 30716593749.13 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
14 run-4.0-gemfiles/dry_validation.gemfile - 30716593749.14 01 Aug 2026 08:16PM UTC 166
58.08
GitHub Action Run
15 run-3.3-gemfiles/rails_7_2.gemfile - 30716593749.15 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
16 run-3.4-gemfiles/rack_2_2.gemfile - 30716593749.16 01 Aug 2026 08:16PM UTC 166
95.55
GitHub Action Run
17 run-4.0-gemfiles/multi_json_1_20.gemfile - 30716593749.17 01 Aug 2026 08:17PM UTC 166
47.76
GitHub Action Run
18 run-4.0-gemfiles/rails_8_0.gemfile - 30716593749.18 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
19 run-4.0-gemfiles/multi_json.gemfile - 30716593749.19 01 Aug 2026 08:16PM UTC 166
47.73
GitHub Action Run
20 run-4.0-gemfiles/rack_3_0.gemfile - 30716593749.20 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
21 run-4.0-gemfiles/rails_8_1.gemfile - 30716593749.21 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
22 run-3.4-gemfiles/rack_3_2.gemfile - 30716593749.22 01 Aug 2026 08:17PM UTC 166
95.59
GitHub Action Run
23 run-4.0-gemfiles/rack_2_2.gemfile - 30716593749.23 01 Aug 2026 08:16PM UTC 166
95.55
GitHub Action Run
24 run-3.3-gemfiles/rack_3_0.gemfile - 30716593749.24 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
25 run-4.0-gemfiles/grape_entity.gemfile - 30716593749.25 01 Aug 2026 08:16PM UTC 166
50.42
GitHub Action Run
26 run-4.0-gemfiles/rack_3_2.gemfile - 30716593749.26 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
27 run-4.0-gemfiles/rack_3_1.gemfile - 30716593749.27 01 Aug 2026 08:16PM UTC 166
95.59
GitHub Action Run
28 run-3.3-gemfiles/rails_8_1.gemfile - 30716593749.28 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
29 run-4.0-gemfiles/multi_xml.gemfile - 30716593749.29 01 Aug 2026 08:16PM UTC 166
47.12
GitHub Action Run
30 run-3.3-gemfiles/rails_8_0.gemfile - 30716593749.30 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
31 run-4.0-gemfiles/grape_swagger.gemfile - 30716593749.31 01 Aug 2026 08:16PM UTC 166
55.39
GitHub Action Run
32 run-3.4-gemfiles/rails_7_2.gemfile - 30716593749.32 01 Aug 2026 08:16PM UTC 167
95.59
GitHub Action Run
Source Files on build 30716593749
  • Tree
  • List 167
  • 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 #30716593749
  • Pull Request #2839
  • PR Base - master (#30542026971)
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