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

org.javalite.http.Request can set basic auth params from the passed url #1131

Open
alniks opened this issue Jun 15, 2021 · 0 comments
Open

Comments

@alniks
Copy link

alniks commented Jun 15, 2021

If URL's getUserInfo() is not null it could be split and set as basic authentication parameters:

URL url = new URL(address);
String userInfo = url.getUserInfo();
if (userInfo != null) {
    String[] split = userInfo.split(":");
    basic(split[0], split[1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants