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

Proposal for an OptionSet-based reset function. #1552

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mbarnach
Copy link
Member

Allow to reset the buffer before sending the response.

This is an alternate proposition to #1551

WIP, no tests until it is set relevant.

Description

When sending a response using .send, the body content is inaccessible.
But sometimes, it makes sense to reset the buffer before sending,
eg. an error handler that remove internal details,
sending a JSON payload, not knowing if there is already something inside, etc.

Motivation and Context

When capturing internal error and making them more explicit, eg. RFC 7807,
we need to reset the buffer to avoid appending internal content
or sending an invalid (JSON) payload.

How Has This Been Tested?

Not yet.

Checklist:

  • If applicable, I have updated the documentation accordingly.
  • If applicable, I have added tests to cover my changes.

WIP, no tests provided.
This is used for discussion.
@sonarcloud
Copy link

sonarcloud bot commented Apr 22, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

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

Successfully merging this pull request may close these issues.

None yet

1 participant