Aiven-Open / Aiven-Open/rohmu

S3 doesn't work with literal IPv6 hosts

オープン
#159 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
22
フォーク
16
平均マージ
2日 19時間
マージ済み PR(30日)
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。