Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommonClient: Explicitly parse url arg as an archipelago:// url #3568

Merged
merged 7 commits into from
Sep 8, 2024
13 changes: 8 additions & 5 deletions CommonClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,11 +1039,14 @@ async def main(args):

if args.url:
url = urllib.parse.urlparse(args.url)
args.connect = url.netloc
if url.username:
args.name = urllib.parse.unquote(url.username)
if url.password:
args.password = urllib.parse.unquote(url.password)
if url.scheme == "archipelago":
args.connect = url.netloc
if url.username:
args.name = urllib.parse.unquote(url.username)
if url.password:
args.password = urllib.parse.unquote(url.password)
Comment on lines -1042 to +1047
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part is still needed, if that's rolled into a different PR or this PR is reopened removing the Launcher.py changes idc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll reopen this and look at it soon, what exactly does this part do on its own?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently argparse grabs the first positional arg and throws it into url, that's to be expected but does mean that launcher "text client" puts the component name in the url block, this causes issues because the highlighted code block only checks if there is a url arg before overriding things

the updated code just confirms that the scheme of the url is correct (i.e. archipelago://blah@blah) before applying any of the available values to the ctx to stop mishandling of any potential bad data

else:
parser.error(f"bad url, found {args.url}, expected url in form of archipelago://archipelago.gg:38281")

colorama.init()

Expand Down
Loading