Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove unsafe URLCredential optional fields force unwrapping #2184
Thanks for the PR! However, before we merge, it would be a good idea to make this encoding a little more elegant, as empty username or password fields aren't usually the best behavior in some scenarios. Can you look into how cURL handles various types of auth and how
I agree @jshier. I remember I looked into this a while back and it's much more complicated than this PR makes it. Certain types of auth support passwords and not usernames, etc. We need to make sure the cURL representation works in all the various cases.
As a temporary solution to the crash issue, I'd suggest we add a guard to ensure both the user and password exist on the credential, otherwise skip it. That is essentially all we support correctly today, so that change would just make it safe.