Skip to content

HttpComponentsStreamingClientHttpRequest fails if restTemplate has interceptors [SPR-17113] #21650

Closed
@spring-projects-issues

Description

@spring-projects-issues

raoofm opened SPR-17113 and commented

need to set Interceptors as empty, since InterceptingHttpAccessor.getRequestFactory returns InterceptingClientHttpRequestFactory which in turn makes an instance of InterceptingClientHttpRequest which does not extend StreamingHttpOutputMessage and AbstractHttpMessageConverter.write checks if (outputMessage instanceof StreamingHttpOutputMessage) { which will be false and ResourceHttpMessageConverter.writeInternal which calls outputMessage.getBody() where outputMessage is an instance of HTTPOutputMessage and not StreamingHttpOutputMessage, should return something like InterceptingStreamingClientHttpRequestFactory For now when we set empty Interceptors, returns the correct delegate (HttpComponentsClientHttpRequestFactory)


Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions