Skip to content

Commit

Permalink
fix(fake_ip): bug with converting
Browse files Browse the repository at this point in the history
  • Loading branch information
jayceslesar committed Jun 2, 2024
1 parent 5e398d5 commit 30b2ac7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased


## [1.0.0] - 2024-06-02
## v1.0.1 - 2024-06-02

### Fixed

- Bug with converting fake_ip correctly


## v1.0.0 - 2024-06-02

### Added

Expand Down
2 changes: 1 addition & 1 deletion masterbase/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def provision(request: Request) -> Redirect:
"""
# enforce https on base_url
base_url = str(request.base_url)
if not base_url.startswith("https") and not os.environ["DEVELOPMENT"]:
if not base_url.startswith("https"):
base_url = base_url.replace("http", "https")

auth_params = {
Expand Down
5 changes: 2 additions & 3 deletions masterbase/guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ async def valid_session_guard(connection: ASGIConnection, _: BaseRouteHandler) -
api_key = get_steam_api_key()
fake_ip = connection.query_params["fake_ip"]

to_resolve, port = fake_ip.split(":")
fake_ip = f"{resolve_hostname(fake_ip)}:{port}"

# 169 servers are behind SDR...
if fake_ip.startswith("169"):
ip, fake_port = fake_ip.split(":")
Expand All @@ -99,6 +96,8 @@ async def valid_session_guard(connection: ASGIConnection, _: BaseRouteHandler) -
except KeyError:
raise NotAuthorizedException(f"Cannot accept data from a non-existent gameserver! ({fake_ip})")
else:
to_resolve, port = fake_ip.split(":")
fake_ip = f"{resolve_hostname(fake_ip)}:{port}"
query = Query(api_key, {"gameaddr": fake_ip})
servers = query.query()
if not servers:
Expand Down

0 comments on commit 30b2ac7

Please sign in to comment.