Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

x-x-z
Copy link

@x-x-z x-x-z commented May 8, 2018

This pull request adds Basic Authorization for UrlResource.
This is fix for spring-projects/spring-boot#6138

@pivotal-issuemaster
Copy link

@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.

@pivotal-issuemaster
Copy link

@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()));
Copy link
Contributor

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()?

Copy link
Author

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"

@dstepanov
Copy link

👍
It would be nice if this change has been merged.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 24, 2019
@rstoyanchev rstoyanchev added the in: core Issues in core modules (aop, beans, core, context, expression) label Nov 11, 2021
@snicoll
Copy link
Member

snicoll commented Sep 26, 2022

@x-x-z can you share how this is a fix for the issue you've linked?

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Sep 26, 2022
@snicoll snicoll changed the title Added Basic Authorization for UrlResource. Fixes gh-6138 Added Basic Authorization for UrlResource Sep 26, 2022
@snicoll snicoll self-assigned this Aug 22, 2023
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 22, 2023
@snicoll snicoll added this to the 6.1.0-RC1 milestone Aug 22, 2023
snicoll pushed a commit that referenced this pull request Aug 22, 2023
snicoll added a commit that referenced this pull request Aug 22, 2023
@snicoll snicoll closed this in 18813de Aug 22, 2023
@snicoll
Copy link
Member

snicoll commented Aug 22, 2023

Sorry for the delay @x-x-z and thanks very much for making your first contribution to Spring Framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants