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

Avoid panic for file url #3306

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Avoid panic for file url #3306

merged 1 commit into from
Apr 29, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Apr 29, 2024

When using find links with a file url, we shouldn't panic because we can't remove username/password for a host-less url.

See #3262

When using find links with a file url, we shouldn't panic because we can't remove username/password for a host-less url.
@konstin konstin added the bug Something isn't working label Apr 29, 2024
@konstin konstin requested a review from zanieb April 29, 2024 11:15
Comment on lines -35 to +36
url.set_password(None).unwrap();
url.set_username("").unwrap();
let _ = url.set_password(None);
let _ = url.set_username("");
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't we return on line 31 if there's no host? or line 26 if there cannot be a base? Weird.

Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Regardless, panicking here seems weird.

@konstin konstin merged commit cedb825 into main Apr 29, 2024
40 checks passed
@konstin konstin deleted the konsti/avoid-panic-for-file-url branch April 29, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants