S3 doesn't work with literal IPv6 hosts
未關閉
- 主要語言
- Python
- 星號
- 22
- 分支
- 16
- 平均合併
- 2 天 19 小時
- 30 天內合併 PR
- 4
描述
When using `S3Transfer` with `host` being an IPv6 address such as `::1` Rohmu fails. This can happen when using a "non-S3 S3" such as [MinIO](https://min.io/) and IPv6.
The exact reason of the failure is here:
https://github.com/Aiven-Open/rohmu/blob/a9aea97c841a42aa38b9e3870f37333e6fdd3dae/rohmu/object_storage/s3.py#L155
According to [RFC 2732](https://www.ietf.org/rfc/rfc2732.txt)
> To use a literal IPv6 address in a URL, the literal address should be enclosed in "[" and "]" characters.
Obviously, the code doesn't do this.
I tried with a simple change and Rohmu seems to work.
```python
custom_url = f"{scheme}://[{host}]:{port}"
```
貢獻指南
評估
這個 Issue 還沒有評估資料。