diff --git a/CHANGELOG.md b/CHANGELOG.md index 62b74939a1bcfa07b60dd60a2e51aa352237332b..c73d60f98eeea12d3f67a52be20cedbfcc0b6d13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### - [#113](https://gitlab.com/linkahead/linkahead-pylib/-/issues/113) Container could fail to delete when there were reference properties. +- HTTP status 431 (Headers too long) now also raises an URI too long exception. ### Security ### diff --git a/src/linkahead/connection/connection.py b/src/linkahead/connection/connection.py index db6b66f17dd3eb8c4415119912d5586c6543b953..91b4a01da455d0f365e39b0b0f7359e07096e707 100644 --- a/src/linkahead/connection/connection.py +++ b/src/linkahead/connection/connection.py @@ -509,7 +509,8 @@ def _handle_response_status(http_response): raise LoginFailedError(standard_message) elif status == 403: raise HTTPForbiddenError(standard_message) - elif status in (413, 414): + elif status in (413, 414, 431): + # Content (413), URI (414) or complete HTTP headers (URI+headers) (431) too long raise HTTPURITooLongError(standard_message) elif 399 < status < 500: raise HTTPClientError(msg=standard_message, status=status, body=body)