proxy-wasm-rust-sdk icon indicating copy to clipboard operation
proxy-wasm-rust-sdk copied to clipboard

Support reading header during handling bodies

Open danielkwinsor opened this issue 2 years ago • 0 comments

Under version 0.1.4, I am using HttpContext to write logic on_http_request_headers and on_http_request_body (same for response).

I would like, when handling a body, to at least be able to read the headers of the associated request, through get_http_request_header. Instead, I get a panic panicked at 'unexpected status: 2' from proxy-wasm-0.1.4/src/hostcalls.rs:261:23

A specific use case is logging a body, but at the same time extracting and printing a traceId from header.

I see that #114 is similar; there may be cases where editing the headers even while handling the body may be valuable. However, that one is for editing, while this ticket might be limited to read-only.

danielkwinsor avatar May 31 '22 21:05 danielkwinsor