Welcome! Log In Create A New Profile

Advanced

Force chunked response in redirect

Posted by rimbalza 
Force chunked response in redirect
September 21, 2023 11:10AM
Hi, I need to send back a redirect for a specific location. This is easy but I need the reply to the client to be encoded as chuncked. This is because we have a client with a firmware that only understands chunked content and expects a chunked encoding for each reply it gets.
The usual redirect comes as

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Thu, 21 Sep 2023 14:53:13 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://xxx.yyy.zzz/redirectme
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

With the content-length header.
Is it possible to force the use of a chunked encoding in this case? I searched for some way to limit the size of body chunks, thinking to use something like 16 to force chunking, but I only see configurations involving proxied configurations and for data streams.
I need to chunk a 3xx reply.
Is it even possible to send back to the client a pre-canned reply, including headers? In this way I'll prepare the static reply as is always the same, and I'll include also the (fake) chunked encoding.
Thanks
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
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