-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Added Basic Authorization for UrlResource #1822
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
Conversation
@x-x-z Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@x-x-z Thank you for signing the Contributor License Agreement! |
@@ -167,6 +169,12 @@ private URL getCleanedUrl(URL originalUrl, String originalPath) { | |||
public InputStream getInputStream() throws IOException { | |||
URLConnection con = this.url.openConnection(); | |||
ResourceUtils.useCachesIfNecessary(con); | |||
|
|||
if (this.url.getUserInfo() != null) { | |||
String basicAuth = "Basic " + new String(Base64Utils.encode(url.getUserInfo().getBytes())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using Base64Utils.encodeToString()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dreis2211
Thank you for your comment.
I fixed it in "005911e"
👍 |
@x-x-z can you share how this is a fix for the issue you've linked? |
Sorry for the delay @x-x-z and thanks very much for making your first contribution to Spring Framework. |
This pull request adds Basic Authorization for UrlResource.
This is fix for spring-projects/spring-boot#6138