Skip to content

docs: add a Why kuri? section to the README - #161

Merged
OmarAlJarrah merged 3 commits into
mainfrom
docs/readme-why-section
Jul 20, 2026
Merged

docs: add a Why kuri? section to the README#161
OmarAlJarrah merged 3 commits into
mainfrom
docs/readme-why-section

Conversation

@OmarAlJarrah

@OmarAlJarrah OmarAlJarrah commented Jul 20, 2026

Copy link
Copy Markdown
Member

What & why

The README explained what kuri is and how to use it, but not why it exists. This adds a short Why kuri? section after the intro, as a list of points.

Content

  • URL parsing is subtle, and the details most parsers skip (percent-encoding, IDNA hosts, dot-segment resolution, port elision) are where the bugs hide.
  • RFC 3986 and the WHATWG URL Standard differ, and when two parts of a system read a URL differently the gap becomes a real security bug: SSRF filter bypass, origin confusion, poisoned cache key.
  • The JVM built-ins don't help: java.net.URI is specified against the superseded RFC 2396, java.net.URL barely validates and its equals() makes a blocking DNS call, and neither runs off the JVM.
  • Kotlin Multiplatform has no URL type in its standard library, so shared code either drops to a JVM-only parser or reimplements parsing per platform.
  • kuri closes that gap: one conformance-tested parser in common Kotlin, the same result on every target, errors as values, and a choice of spec.

Claims about the JDK were verified against the Corretto JDK source (URI references RFC 2396; URL.equals does a blocking name resolution). Kept short, as points, no tables.

Add a section after the intro explaining the motivation and value: URL
parsing is subtle and the details ad-hoc parsers miss (percent-encoding,
IDNA, dot-segment resolution, port elision) are the ones that cause interop
and security bugs; RFC 3986 and the WHATWG URL Standard genuinely differ;
the platform primitives (java.net.URI/URL) are lenient, quirky, and JVM-only,
leaving Kotlin Multiplatform without a standards-faithful, dependency-free
option. States kuri's priorities in order: measured correctness, two explicit
models, safety on untrusted input, and one API across every target.
Cut the Why section from three paragraphs plus a list down to one paragraph.
Lead with the concrete stakes: parser disagreement turns into SSRF bypasses,
origin confusion, and poisoned cache keys, and the JVM built-ins are lenient,
quirky (URL.equals can hit DNS), and JVM-only. Keep the argument specific and
readable rather than exhaustive.
Convert the Why section from a paragraph to points, and add the Kotlin
Multiplatform angle: the standard library has no URL type, so shared code
either drops to a JVM-only parser or reimplements parsing per platform.
Tighten the platform-primitive claims to what the JDK actually documents:
java.net.URI is specified against the superseded RFC 2396, and
java.net.URL.equals() makes a blocking DNS call.
@OmarAlJarrah
OmarAlJarrah merged commit 3768086 into main Jul 20, 2026
11 checks passed
@OmarAlJarrah
OmarAlJarrah deleted the docs/readme-why-section branch July 20, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant