-
Notifications
You must be signed in to change notification settings - Fork 152
fix: body callbacks return the whole buffered body size #418
Conversation
As I commented, please make sure that each PR has a narrow scope rather than having multiple ones so that we can investigate the history easily later |
d9e391b
to
0306f95
Compare
Thanks, done (and sorry for the hiccup)! This PR has been restricted to the main topic: emulator and related existing Other PRs created are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool thanks!
} | ||
|
||
// Override types.DefaultHttpContext. | ||
func (ctx *setBodyContext) OnHttpRequestHeaders(numHeaders int, endOfStream bool) types.Action { | ||
mode, err := proxywasm.GetHttpRequestHeader("buffer-replace-at") | ||
if mode == "response" { | ||
if err == nil && mode == "response" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious what's the reason for this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err
is retrieved but not used. I was in doubt about whether not even retrieve it, or to ensure it was nil before relying on mode
Following #414 discussion this PR tries to:
ProxyOnRequestBody
andProxyOnResponseBody
the size of the whole body buffer, not of the individual chunk.http_body
example.Adds→ See example: adds http_body_chunk #421http_body_chunk
example showing how to read chunk by chunk while buffering.nit: fix: typo #410→ See chore: fixes typos #419upgrades support for latest envoy and istio/proxyv2→ See chore: upgrades support for latest envoy and istio/proxyv2 #420Tentatively closes #414.