lua: Add setBytes() API to the buffer wrapper#13172
Merged
dio merged 4 commits intoenvoyproxy:masterfrom Sep 22, 2020
dio:lua-set-bytes
Merged
lua: Add setBytes() API to the buffer wrapper#13172dio merged 4 commits intoenvoyproxy:masterfrom dio:lua-set-bytes
dio merged 4 commits intoenvoyproxy:masterfrom
dio:lua-set-bytes
Conversation
This patch adds setBytes() API to the buffer wrapper by making the wrapper buffer to be mutable. This allows rewriting upstream data in the response path. Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
|
@dio do you have an example of lua code to do this? |
Member
Author
|
@ceastman-ibm yes, sorry if it is not obvious: https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/lua_filter#script-examples at the end of this section. https://github.com/envoyproxy/envoy/pull/13172/files#diff-6fdb0e5fbf091e65aebffac556d8a5bbR240. |
Why not in the request path? |
Member
Author
|
@ikingye do you mean you want to add more data to the request to upstream as well? |
|
@dio Hello! |
|
Hello, @dio. Does this allow to rewrite the downstream data (envoy_on_request) as well? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: This patch adds
setBytes()API to the buffer wrapper by making the wrapped buffer to be mutable. This allows rewriting upstream data in the response path.Risk Level: Low
Testing: Added unit and integration tests.
Docs Changes: Added
Release Notes: Added
Fixes #5998
Signed-off-by: Dhi Aurrahman dio@tetrate.io