Skip to content

Commit

Permalink
fix(late bytes): serialization bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jayceslesar committed Jun 2, 2024
1 parent b5747d4 commit f10bd5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased


## v1.0.1 - 2024-06-02

### Fixed

- Bug with converting fake_ip correctly
- LateBytesBody serialization bug


## v1.0.0 - 2024-06-02
Expand Down
3 changes: 2 additions & 1 deletion masterbase/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def late_bytes(request: Request, api_key: str, data: LateBytesBody) -> dict[str,
engine = request.app.state.engine
current_time = datetime.now().astimezone(timezone.utc)
steam_id = steam_id_from_api_key(engine, api_key)
late_bytes_helper(engine, steam_id, data.converted_late_bytes, current_time)
converted_late_bytes = bytes.fromhex(data.late_bytes)
late_bytes_helper(engine, steam_id, converted_late_bytes, current_time)

return {"late_bytes": True}

Expand Down
3 changes: 0 additions & 3 deletions masterbase/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ class LateBytesBody(BaseModel):

late_bytes: str

def model_post_init(self, __context: Any) -> None:
"""Convert late_bytes to bytes."""
self.converted_late_bytes = bytes.fromhex(self.late_bytes)

0 comments on commit f10bd5e

Please sign in to comment.