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

fixes #753 handle text/plain and content type missing in BodyHandler #755

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

stevehu
Copy link
Contributor

@stevehu stevehu commented Aug 25, 2020

No description provided.

Copy link

@ericbroda ericbroda left a comment

Choose a reason for hiding this comment

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

There may still be a problem - I found with the original InfluxDB sender code with no content type fell through to code that actually did not get the inputstream content (rather, it returned null). So I figure, the no-content condition needs to either (a) throw error (content type missing), or, (b) needs to be coded to return the request body... we may want to use the same (new code) for "text/plain" as for when no content type is provided...

Thoughts?

@stevehu
Copy link
Contributor Author

stevehu commented Aug 25, 2020

In the previous implementation, the BodyHandler will be passed if content-type is empty. In that case, the business handler must parse the body by itself which might be a burden for most users. After the change, we just put the input stream into the exchange and treat it as a binary stream. The business hander can just get the input stream from the exchange and consume it. It is the same process for an unknown content type.

@ericbroda
Copy link

That makes sense, but I think we may want to document that pretty well.

@stevehu stevehu merged commit de20020 into master Aug 25, 2020
@stevehu stevehu deleted the issue753 branch August 25, 2020 17:57
@stevehu
Copy link
Contributor Author

stevehu commented Aug 25, 2020

You are right about the documentation. I have updated the BodyHandler doc to reflect the changes. Thanks.

networknt/light-doc#194

younggwon1 pushed a commit to younggwon1/light-4j that referenced this pull request Feb 10, 2024
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

2 participants