diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/rust/echo-request/src/lib.rs | 8 | ||||
-rw-r--r-- | examples/rust/upload-reflector/src/lib.rs | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/examples/rust/echo-request/src/lib.rs b/examples/rust/echo-request/src/lib.rs index d65cfb0..943c514 100644 --- a/examples/rust/echo-request/src/lib.rs +++ b/examples/rust/echo-request/src/lib.rs @@ -102,12 +102,8 @@ pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 { // storing the response headers at the beginning of our shared // memory at offset 0. uwr_http_init_headers(ctx, 2, 0); - uwr_http_add_header(ctx, "Content-Type", "text/plain"); - uwr_http_add_header( - ctx, - "Content-Length", - &format!("{}", uwr_get_response_data_size(ctx)), - ); + uwr_http_add_header_content_type(ctx, "text/plain"); + uwr_http_add_header_content_len(ctx); // This calls nxt_wasm_send_headers() in Unit uwr_http_send_headers(ctx); diff --git a/examples/rust/upload-reflector/src/lib.rs b/examples/rust/upload-reflector/src/lib.rs index 43bd1c6..753ea48 100644 --- a/examples/rust/upload-reflector/src/lib.rs +++ b/examples/rust/upload-reflector/src/lib.rs @@ -49,7 +49,7 @@ pub fn upload_reflector(ctx: *mut luw_ctx_t) -> i32 { } uwr_http_init_headers(ctx, 2, 0); - uwr_http_add_header(ctx, "Content-Type", ct); + uwr_http_add_header_content_type(ctx, ct); uwr_http_add_header( ctx, "Content-Length", |