aio-libs / aio-libs/yarl

[TODO] Research compatibility with RFC 6874 and cover it with tests

Open
#998 6 comments 0 reactions 0 assignees View on GitHub
bug enhancement Hacktoberfest help wanted
Dominant language
Python
Stars
1.5k
Forks
215
Avg merge
1d 2m
Merged PRs (30d)
13

Description

### Describe the bug

I recently faced missing support for IPv6 URLs with scoped Zone ID suffixes in modern web-browsers. Apparently, they're pointing fingers to each other being unable to decide who should implement/formalize it first (https://ungleich.ch/u/blog/ipv6-link-local-support-in-browsers/).
But there's RFC 6874 that seems to be accepted (although some places on the internet label it as a "proposed standard"). Still, this is something that many libs look up to so we should too. That standard insists on the separator being a URL-encoded `%25` (while a point was made for supporting unencoded `%` for backwards compatibility: https://github.com/urllib3/urllib3/issues/1641#issuecomment-1151830010).

I briefly checked yarl's code and it seems to me that `%25` is never supported (strings are partitioned by `"%"`). There are no test cases that specify the expectations explicitly. We should introduce those and make sure the implementation is consistent with the standard.

### To Reproduce

Research needed. I'm just documenting this as a "TODO".

### Expected behavior

The behavior should be aligned with https://github.com/urllib3/urllib3/issues/1641 and popular implementations outside the Python ecosystem, like cURL.

### Logs/tracebacks

```python-traceback
N/A
```

### Python Version

```console
N/A
```

### multidict Version

```console
N/A
```

### yarl Version

```console
N/A
```

### OS

N/A

### Additional context

https://datatracker.ietf.org/doc/html/rfc6874

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.