proxy-wasm / proxy-wasm-rust-sdk

WebAssembly for Proxies (Rust SDK)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support reading header during handling bodies

danielkwinsor opened this issue · 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.