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

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

Closed
spring-projects-issues opened this issue Jul 23, 2018 · 0 comments
Assignees
Labels
in: web type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 23, 2018

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

@spring-projects-issues spring-projects-issues added type: bug in: web labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0.8 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: bug
Projects
None yet
Development

No branches or pull requests

2 participants