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

Http server: Allow to disable not-found on missing body #11059

Merged
merged 14 commits into from
Aug 13, 2024
Merged

Conversation

dstepanov
Copy link
Contributor

No description provided.

@dstepanov dstepanov added the type: improvement A minor improvement to an existing feature label Aug 7, 2024
Copy link
Contributor

@sdelamo sdelamo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a mention in https://github.com/micronaut-projects/micronaut-core/blob/4.6.x/src/main/docs/guide/httpServer/serverIO.adoc#404-responses to tell users how to disable this behaviour and what would be the behaviour if they set an not-found-on-missing-bodytofalse`

@@ -678,8 +687,7 @@ private CorePublisher<MutableHttpResponse<?>> fromReactiveExecute(PropagatedCont
}
return response.contextWrite(context -> ReactorPropagation.addPropagatedContext(context, propagatedContext).put(ServerRequestContext.KEY, request));
}
MutableHttpResponse<?> response = forStatus(routeInfo, null).body(body);
return processPublisherBody(propagatedContext, request, response, routeInfo);
return processPublisherBody(propagatedContext, request, forStatus(routeInfo, null), false, publisher, routeInfo);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the .body gone?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a bit of refactoring to pass the converted publisher right away

@dstepanov
Copy link
Contributor Author

Added docs @sdelamo

@sdelamo sdelamo added this to the 4.6.0 milestone Aug 12, 2024
renovate bot and others added 5 commits August 13, 2024 07:13
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Copy link

sonarcloud bot commented Aug 13, 2024

@sdelamo sdelamo merged commit dd0b289 into 4.6.x Aug 13, 2024
17 checks passed
@sdelamo sdelamo deleted the contrnull branch August 13, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants