Skip to content

Commit

Permalink
lua: mention that body should be consumed before fetching trailers (e…
Browse files Browse the repository at this point in the history
…nvoyproxy#36553)

<!--
!!!ATTENTION!!!

If you are fixing *any* crash or *any* potential security issue, *do
not*
open a pull request in this repo. Please report the issue via emailing
envoy-security@googlegroups.com where the issue will be triaged
appropriately.
Thank you in advance for helping to keep Envoy secure.

!!!ATTENTION!!!

For an explanation of how to fill out the fields, please see the
relevant section
in
[PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md)
-->

Commit Message: lua: mention that body should be consumed before
fetching trailers
Additional Description:
Risk Level: Zero
Testing: N/A
Docs Changes: lua_filter.rst
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
Fixes envoyproxy#36507
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Signed-off-by: Gustavo <grnmeira@gmail.com>
  • Loading branch information
spacewander authored and grnmeira committed Oct 17, 2024
1 parent 9cb8430 commit 1cb3b84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/root/configuration/http/http_filters/lua_filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,10 @@ trailers()
local trailers = handle:trailers()
Returns the stream's trailers. May return nil if there are no trailers. The trailers may be
modified before they are sent to the next filter.
Returns the stream's trailers. Before calling this method, the caller should call ``body()`` or
``bodyChunks()`` to consume the body, otherwise the trailers will not be available.
May return nil if there are no trailers. The trailers may be modified before they are sent
to the next filter.

Returns a :ref:`header object <config_http_filters_lua_header_wrapper>`.

Expand Down

0 comments on commit 1cb3b84

Please sign in to comment.