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

valkyrjaio / valkyrja-java / 30719974113
100%

Build:
DEFAULT BRANCH: 26.x
Ran 01 Aug 2026 09:51PM UTC
Jobs 1
Files 671
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 09:50PM UTC coverage: 100.0%. Remained the same
30719974113

push

github

web-flow
[Http] fix: Percent-encode the uri user info, host, path, query, and fragment (#99)

# Description

`Uri` did not filter any of its components.
`UriFactory::filterUserInfo`, `filterPath`,
`filterQuery`, and `filterFragment` were stubs: they trimmed a leading
delimiter and returned
the value unchanged. A caller could put a space, a control character, or
any other character
that RFC 3986 reserves straight into a uri, and `__toString` emitted it
verbatim.

This PR implements the four filters and adds `filterHost`. Each
component now percent-encodes
the characters that RFC 3986 does not allow it to carry unencoded:

| Component | Allowed unencoded |
|-----------|-------------------|
| User info | unreserved, sub-delimiters, `:` |
| Host (reg-name) | unreserved, sub-delimiters |
| Path | unreserved, sub-delimiters, `:`, `@`, `/` |
| Query and fragment | unreserved, sub-delimiters, `:`, `@`, `/`, `?` |

One shared `encode` method does the work for every component. It reads a
valid percent-encoded
triplet as a single unit, so a value that arrives encoded is not encoded
a second time, and the
filters are idempotent. The triplet's hexadecimal digits become
uppercase, which is the
canonical form in RFC 3986 section 6.2.2.1. A percent sign that does not
begin a valid triplet
is a literal percent sign, so `encode` escapes it to `%25`.

A host gets two more rules. An IP literal is in brackets and holds
colons that a reg-name does
not allow, so `filterHost` returns it unchanged. Every other host is a
reg-name, which
`filterHost` lowercases and then encodes. The bracket rule is
load-bearing: `MarshalUriFactory`
builds `[` + `SERVER_ADDR` + `]` for an IPv6 address, and without it
that host became
`%5B%3A%3A1%5D`.

## The witheres now filter too

The constructor filtered the user info and lowercased the host, but
`withUserInfo` and
`withHost` did neither. `getHost()` therefore depended on how the `Uri`
was built, and
implementing `filterUserInfo` alone would have left... (continued)

1929 of 1929 branches covered (100.0%)

Branch coverage included in aggregate %.

27 of 27 new or added lines in 2 files covered. (100.0%)

7056 of 7056 relevant lines covered (100.0%)

4.33 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30719974113.1 01 Aug 2026 09:51PM UTC 671
100.0
GitHub Action Run
Source Files on build 30719974113
  • Tree
  • List 671
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30719974113
  • 3c9f81dc on github
  • Prev Build on 26.x (#30718383987)
  • Next Build on 26.x (#30723567600)
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