Skip to content

Conversation

@QuinnHarris
Copy link
Contributor

@QuinnHarris QuinnHarris commented Dec 19, 2025

RFC 3986 explicitly allows both : and @ to appear unescaped in URL path segments and query strings (pchar):

pchar = unreserved / pct-encoded / sub-delims / ":" / "@"

However, zio-http currently percent-encodes these characters even when they appear in contexts where they are treated as data rather than delimiters.

This PR updates URL rendering to allow : and @ to remain unescaped in path and query segments both using the encodeComponentInto function.

I specifically required this change when using google validateAddress API with URL https://addressvalidation.googleapis.com/v1:validateAddress that does not work when it is percent-encoded.

References

  • RFC 3986 §3.3 (Path)
  • RFC 3986 §3.4 (Query)

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for zio-http ready!

Name Link
🔨 Latest commit ea869e5
🔍 Latest deploy log https://app.netlify.com/projects/zio-http/deploys/695ee6d966b32d00088dcf9e
😎 Deploy Preview https://deploy-preview-3870--zio-http.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@987Nabil
Copy link
Contributor

@QuinnHarris please fix this

[error] /home/runner/work/zio-http/zio-http/zio-http/jvm/src/test/scala/zio/http/URLSpec.scala:165:24: type mismatch;
[error]  found   : Option[zio.http.URL.Fragment]
[error]  required: Option[a.Fragment]
[error]             assertTrue(URL(path = path).encode == path.encode)
[error]                        ^
[error] /home/runner/work/zio-http/zio-http/zio-http/jvm/src/test/scala/zio/http/URLSpec.scala:165:23: not found: value location
[error]             assertTrue(URL(path = path).encode == path.encode)
[error]                       ^

@QuinnHarris QuinnHarris force-pushed the component-allow-extra branch from ab8c51c to 2de4e76 Compare January 5, 2026 15:05
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.

2 participants