Skip to content

MVC not rendering response headers for ResponseEntity<Flux<Foo>> [SPR-17076] #21614

@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-17076 and commented

Controller:

@GetMapping("/one")
public ResponseEntity<Flux<Foo>> one() {
     return ResponseEntity.ok().header("x-foo", "spam")
               .body(Flux.just(new Foo("foo"), new Foo("bar")));
}

Failing test:

@Test
public void one() {
     ResponseEntity<String> result = rest.getForEntity("/one", String.class);
     assertThat(result.getBody()).contains("\"value\":\"bar\"}");
     assertThat(result.getHeaders()).containsKey("x-foo");
}

The same code works as expected with webflux (just changing dependency).


Affects: 5.0.7

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions