Skip to content

Commit f99c6e6

Browse files
authored
fix[stac_fastapi.core]: await request.body() coroutine (#551)
**Related Issue(s):** N/A **Description:** Fixes an unawaited coroutine: ``` stac_fastapi/core/core.py:762: RuntimeWarning: coroutine 'Request.body' was never awaited if request.method == "POST" and request.body(): ``` `request.body()` always had a bool value of `True` as it is the coroutine, not the result. **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [ ] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog
1 parent d318e59 commit f99c6e6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313

1414
### Fixed
1515

16+
- Fix unawaited coroutine in `stac_fastapi.core.core`. [#551](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/551)
17+
1618
### Removed
1719

1820
### Updated

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ async def post_search(
759759

760760
body_limit = None
761761
try:
762-
if request.method == "POST" and request.body():
762+
if request.method == "POST" and await request.body():
763763
body_data = await request.json()
764764
body_limit = body_data.get("limit")
765765
except Exception:

0 commit comments

Comments
 (0)