Welcome! Log In Create A New Profile

Advanced

Re: Why body filter not work

Maxim Dounin
August 06, 2014 08:48AM
Hello!

On Wed, Aug 06, 2014 at 02:58:16PM +0800, Jerry OELoo wrote:

> Hi.
> I just copy the code from Evan Miller's body filter.
> http://www.evanmiller.org/nginx-modules-guide.html#filters-body,
> however, In my browser I could not see inserted string (<!-- Served by
> Nginx -->)

The chapter in question doesn't looks correct - it tries to modify
chain links passed to the filter (that is, chain links that belong
to some other module), which is wrong thing to do. Instead, one
should allocate new chain links, and construct a new chain with
them.

In any case though it may be better idea to test with something
more suitable for testing than browser. E.g., telnet or netcat
may be better.

> And I found that request header.
>
> Transfer-Encoding: chunked
>
> Is anything that I am wrong. Thanks.

The "Transfer-Encoding: chunked" header is correct as long as
response size isn't known in advance. See here for details:

http://tools.ietf.org/html/rfc7230#section-4.1

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Why body filter not work

Jerry OELoo August 06, 2014 03:00AM

Re: Why body filter not work

Maxim Dounin August 06, 2014 08:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready