diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c/luw-echo-request.c | 4 | ||||
-rw-r--r-- | examples/c/luw-upload-reflector.c | 4 | ||||
-rw-r--r-- | examples/rust/echo-request/src/lib.rs | 3 | ||||
-rw-r--r-- | examples/rust/upload-reflector/src/lib.rs | 3 |
4 files changed, 6 insertions, 8 deletions
diff --git a/examples/c/luw-echo-request.c b/examples/c/luw-echo-request.c index 5655c65..66c3880 100644 --- a/examples/c/luw-echo-request.c +++ b/examples/c/luw-echo-request.c @@ -85,8 +85,8 @@ int luw_request_handler(u8 *addr) luw_http_init_headers(&ctx, 2, 0); snprintf(clen, sizeof(clen), "%lu", luw_get_response_data_size(&ctx)); - luw_http_add_header(&ctx, 0, "Content-Type", "text/plain"); - luw_http_add_header(&ctx, 1, "Content-Length", clen); + luw_http_add_header(&ctx, "Content-Type", "text/plain"); + luw_http_add_header(&ctx, "Content-Length", clen); luw_http_send_headers(&ctx); diff --git a/examples/c/luw-upload-reflector.c b/examples/c/luw-upload-reflector.c index 95bc514..5abce9f 100644 --- a/examples/c/luw-upload-reflector.c +++ b/examples/c/luw-upload-reflector.c @@ -57,8 +57,8 @@ static int upload_reflector(luw_ctx_t *ctx) luw_get_http_content_len(ctx)); luw_http_init_headers(ctx, 2, 0); - luw_http_add_header(ctx, 0, "Content-Type", ct ? ct : defct); - luw_http_add_header(ctx, 1, "Content-Length", clen); + luw_http_add_header(ctx, "Content-Type", ct ? ct : defct); + luw_http_add_header(ctx, "Content-Length", clen); luw_http_send_headers(ctx); } diff --git a/examples/rust/echo-request/src/lib.rs b/examples/rust/echo-request/src/lib.rs index 3fea8d5..235ad13 100644 --- a/examples/rust/echo-request/src/lib.rs +++ b/examples/rust/echo-request/src/lib.rs @@ -104,10 +104,9 @@ 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, 0, "Content-Type", "text/plain"); + uwr_http_add_header(ctx, "Content-Type", "text/plain"); uwr_http_add_header( ctx, - 1, "Content-Length", &format!("{}", uwr_get_response_data_size(ctx)), ); diff --git a/examples/rust/upload-reflector/src/lib.rs b/examples/rust/upload-reflector/src/lib.rs index 01138b0..43bd1c6 100644 --- a/examples/rust/upload-reflector/src/lib.rs +++ b/examples/rust/upload-reflector/src/lib.rs @@ -49,10 +49,9 @@ pub fn upload_reflector(ctx: *mut luw_ctx_t) -> i32 { } uwr_http_init_headers(ctx, 2, 0); - uwr_http_add_header(ctx, 0, "Content-Type", ct); + uwr_http_add_header(ctx, "Content-Type", ct); uwr_http_add_header( ctx, - 1, "Content-Length", &format!("{}", uwr_get_http_content_len(ctx)), ); |