From 029dfd4f59778ecb3d5a7e65615eb6e08a9a0459 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 21 Nov 2023 22:16:00 +0100 Subject: [PATCH] Add charset to get_enhet()'s Accept header --- src/brreg/enhetsregisteret/_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/brreg/enhetsregisteret/_client.py b/src/brreg/enhetsregisteret/_client.py index 35b7443..549f7d4 100644 --- a/src/brreg/enhetsregisteret/_client.py +++ b/src/brreg/enhetsregisteret/_client.py @@ -67,7 +67,10 @@ def get_enhet(self, organisasjonsnummer: str) -> Optional[Enhet]: res = self._client.get( f"/enheter/{organisasjonsnummer}", headers={ - "accept": "application/vnd.brreg.enhetsregisteret.enhet.v2+json" + "accept": ( + "application/vnd.brreg.enhetsregisteret.enhet.v2+json;" + "charset=UTF-8" + ) }, ) if res.status_code in (404, 410):