Skip to content

Commit 85ddfb0

Browse files
authored
Merge pull request #65 from uclahs-cds/aholmes-fix-query-string-crash
Fix problem with application crashing when query string is stored as bytes
2 parents 99162e6 + bf7be15 commit 85ddfb0

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

CHANGELOG.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
99

1010
## [Unreleased]
1111

12-
# `BL_Python.web` [0.2.1] - 2024-05-16
13-
- [BL_Python.web v0.2.1](https://github.com/uclahs-cds/BL_Python/blob/BL_Python.web-v0.2.1/src/web/CHANGELOG.md#021---2024-05-16)
12+
# `BL_Python.web` [0.2.2] - 2024-05-16
13+
- [BL_Python.web v0.2.2](https://github.com/uclahs-cds/BL_Python/blob/BL_Python.web-v0.2.2/src/web/CHANGELOG.md#022---2024-05-16)
1414

1515
# `BL_Python.platform` [0.2.2] - 2024-05-16
16-
- [BL_Python.platform v0.2.2](https://github.com/uclahs-cds/BL_Python/blob/BL_Python.platform-v0.2.2/src/platform/CHANGELOG.md#021---2024-05-16)
16+
- [BL_Python.platform v0.2.2](https://github.com/uclahs-cds/BL_Python/blob/BL_Python.platform-v0.2.2/src/platform/CHANGELOG.md#022---2024-05-16)
17+
18+
# `BL_Python.all` [0.2.3] - 2024-05-16
19+
- Contains all libraries up to v0.2.1, and `BL_Python.platform` v0.2.2 and `BL_Python.web` v0.2.2
1720

1821
# [0.2.0] - 2024-05-14
1922
### Added

src/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__: str = "0.2.2"
1+
__version__: str = "0.2.3"

src/web/BL_Python/web/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__: str = "0.2.1"
1+
__version__: str = "0.2.2"

src/web/BL_Python/web/middleware/openapi/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,12 @@ async def __call__(
530530
}),
531531
)
532532

533+
# Some values, like the query string, are stored as bytes.
534+
# Decode as a UTF-8 str so encoding later doesn't fail.
535+
for key, value in request_environ.items():
536+
if isinstance(value, bytes):
537+
request_environ[key] = value.decode("utf-8")
538+
533539
request_ctx = exit_stack.enter_context(
534540
app.request_context(request_environ)
535541
)

src/web/CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Review the `BL_Python` [CHANGELOG.md](https://github.com/uclahs-cds/BL_Python/bl
1010

1111
---
1212

13-
## [0.2.1] - 2024-05-16
13+
## [0.2.2] - 2024-05-16
1414
### Changed
1515
- Ignore sentinel files created by `make`.
1616

1717
### Fixed
1818
- Update type annotation for variable causing new failure in Pyright.
19+
- Resolved crash when query string is stored as a byte array.

0 commit comments

Comments
 (0)