proxy-wasm / proxy-wasm-cpp-sdk

WebAssembly for Proxies (C++ SDK)
Apache License 2.0
139 stars 67 forks source link

Can Call onRequestTrailers() and onResponseTrailers unconditionally??? #147

Open coolg92003 opened 1 year ago

coolg92003 commented 1 year ago

Hi Expert, If there is no Trailer in Request/Response, then I have no chance to add Trailer when after processing Request/Response. Is it possible call those two API onRequestTrailers() and onResponseTrailers unconditionally? if there is Not anything to do, then it can return Continue directly.

thanks Cliff

PiotrSikora commented 1 year ago

You can add trailers from the request/response body callbacks (e.g. upon receiving end_of_stream=True, which implies that there are no trailers).