Aiven-Open / Aiven-Open/rohmu

S3 doesn't work with literal IPv6 hosts

Aberta
#159 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
22
Forks
16
Merge médio
2d 19h
PRs com merge (30d)
4

Descrição

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}"
```

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.