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

RestTemplateBuilder.basicAuth causes the entire body to be read into memory #15078

Closed
philwebb opened this issue Nov 3, 2018 · 5 comments
Closed
Labels
status: superseded An issue that has been superseded by another

Comments

@philwebb
Copy link
Member

philwebb commented Nov 3, 2018

See spring-io/artifactory-resource#27 for background. I'm not sure if we need to just document this as a warning or look for an alternative way to add the header.

@philwebb philwebb added for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Nov 3, 2018
@wilkinsona
Copy link
Member

This feels to me like it should be fixed/enhanced in Framework so that there’s a mechanism for setting request headers without buffering the whole body.

@philwebb
Copy link
Member Author

philwebb commented Nov 5, 2018

Ive raised SPR-17470 to see what Framework can do. I'll leave this one open but blocked since we'll probably need changes regardless.

@philwebb philwebb added type: bug A general bug status: blocked An issue that's blocked on an external project change and removed status: waiting-for-triage An issue we've not yet triaged for: team-attention An issue we'd like other members of the team to review labels Nov 5, 2018
@mbhave
Copy link
Contributor

mbhave commented Jan 25, 2019

Given that the framework issue has been declined, we should decide if we just want to document this or do something else to prevent an OOM error.

@mbhave mbhave removed the status: blocked An issue that's blocked on an external project change label Jan 25, 2019
@wilkinsona wilkinsona added the for: team-attention An issue we'd like other members of the team to review label Jan 25, 2019
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Jan 30, 2019
@philwebb philwebb added this to the 2.2.x milestone Jan 30, 2019
@philwebb
Copy link
Member Author

I think I can probably port spring-io/artifactory-resource@6221578

@philwebb philwebb modified the milestones: 2.2.x, 2.x May 24, 2019
nosan added a commit to nosan/spring-boot that referenced this issue May 29, 2019
…equest factory to add

authentication headers.

Prior to this commit, the `RestTemplateBuilder` and `TestRestTemplate` used the
`BasicAuthenticationInterceptor` interceptor to add headers.

Unfortunately, adding any interceptor causes the entire message body
to be read into a byte array. This causes an `OutOfMemoryError` whenever
a large file is uploaded.

Closes spring-projectsgh-15078
nosan added a commit to nosan/spring-boot that referenced this issue May 29, 2019
…equest factory to add

authentication headers.

Prior to this commit, the `RestTemplateBuilder` and `TestRestTemplate` used the
`BasicAuthenticationInterceptor` interceptor to add headers.

Unfortunately, adding any interceptor causes the entire message body
to be read into a byte array. This causes an `OutOfMemoryError` whenever
a large file is uploaded.

Closes spring-projectsgh-15078
@philwebb
Copy link
Member Author

Closing in favor of PR #17010

@philwebb philwebb added status: superseded An issue that has been superseded by another and removed type: bug A general bug labels May 29, 2019
@philwebb philwebb removed this from the 2.x milestone May 29, 2019
nosan added a commit to nosan/spring-boot that referenced this issue May 29, 2019
…equest factory to add

authentication headers.

Prior to this commit, the `RestTemplateBuilder` and `TestRestTemplate` used the
`BasicAuthenticationInterceptor` interceptor to add headers.

Unfortunately, adding any interceptor causes the entire message body
to be read into a byte array. This causes an `OutOfMemoryError` whenever
a large file is uploaded.

Closes spring-projectsgh-15078
nosan added a commit to nosan/spring-boot that referenced this issue May 30, 2019
…equest factory to add

authentication headers.

Prior to this commit, the `RestTemplateBuilder` and `TestRestTemplate` used the
`BasicAuthenticationInterceptor` interceptor to add headers.

Unfortunately, adding any interceptor causes the entire message body
to be read into a byte array. This causes an `OutOfMemoryError` whenever
a large file is uploaded.

Closes spring-projectsgh-15078
nosan added a commit to nosan/spring-boot that referenced this issue May 30, 2019
…equest factory to add

authentication headers.

Prior to this commit, the `RestTemplateBuilder` and `TestRestTemplate` used the
`BasicAuthenticationInterceptor` interceptor to add headers.

Unfortunately, adding any interceptor causes the entire message body
to be read into a byte array. This causes an `OutOfMemoryError` whenever
a large file is uploaded.

Closes spring-projectsgh-15078
nosan added a commit to nosan/spring-boot that referenced this issue May 30, 2019
…equest factory to add

authentication headers.

Prior to this commit, the `RestTemplateBuilder` and `TestRestTemplate` used the
`BasicAuthenticationInterceptor` interceptor to add headers.

Unfortunately, adding any interceptor causes the entire message body
to be read into a byte array. This causes an `OutOfMemoryError` whenever
a large file is uploaded.

Closes spring-projectsgh-15078
nosan added a commit to nosan/spring-boot that referenced this issue May 30, 2019
…equest factory to add

authentication headers.

Prior to this commit, the `RestTemplateBuilder` and `TestRestTemplate` used the
`BasicAuthenticationInterceptor` interceptor to add headers.

Unfortunately, adding any interceptor causes the entire message body
to be read into a byte array. This causes an `OutOfMemoryError` whenever
a large file is uploaded.

Closes spring-projectsgh-15078
nosan added a commit to nosan/spring-boot that referenced this issue May 31, 2019
…equest factory to add

authentication headers.

Prior to this commit, the `RestTemplateBuilder` and `TestRestTemplate` used the
`BasicAuthenticationInterceptor` interceptor to add headers.

Unfortunately, adding any interceptor causes the entire message body
to be read into a byte array. This causes an `OutOfMemoryError` whenever
a large file is uploaded.

Closes spring-projectsgh-15078
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

3 participants