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

Add reponse_body to be able to provide a custom body (issue 117) #120

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lucabelluccini
Copy link

Hello,
I've tried to implement the missing feature as mentioned on #117
I am still not sure how to handle the content-type header as it seems we're re-using the one sent in the request, if any.

FYI @jsvd

@lucabelluccini lucabelluccini changed the title Add reponse_body to be able to provide a reponse body (issue 117) Add reponse_body to be able to provide a custom body (issue 117) Dec 9, 2019
response.headers().set(HttpHeaderNames.CONTENT_LENGTH, payload.readableBytes());
response.headers().set(HttpHeaderNames.CONTENT_TYPE, "text/plain");
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of removing the response's content-type we could also provide an customization option for it.

Close to response_body it could be also defined a new response_content_type which by default contains text/plain but in case the user could also modify it.
In particular on registration phase, if the user customized the response body then it should be also forced to explicitly define also a response's content-type

Copy link
Author

Choose a reason for hiding this comment

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

Yep it's a nice idea. I hope I'll have a chance to resume working on this 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants