diff --git a/ngx_http_hello_world_module.c b/ngx_http_hello_world_module.c index cebac6c..af8ecab 100644 --- a/ngx_http_hello_world_module.c +++ b/ngx_http_hello_world_module.c @@ -112,14 +112,14 @@ static ngx_int_t ngx_http_hello_world_handler(ngx_http_request_t *r) out.next = NULL; /* just one buffer */ b->pos = ngx_hello_world; /* first position in memory of the data */ - b->last = ngx_hello_world + sizeof(ngx_hello_world); /* last position in memory of the data */ + b->last = ngx_hello_world + sizeof(ngx_hello_world)-1; /* last position in memory of the data */ b->memory = 1; /* content is in read-only memory */ b->last_buf = 1; /* there will be no more buffers in the request */ /* Sending the headers for the reply. */ r->headers_out.status = NGX_HTTP_OK; /* 200 status code */ /* Get the content length of the body. */ - r->headers_out.content_length_n = sizeof(ngx_hello_world); + r->headers_out.content_length_n = sizeof(ngx_hello_world)-1; ngx_http_send_header(r); /* Send the headers */ /* Send the body, and return the status code of the output filter chain. */