-1

Is it possible to change the Content-Length of an HttpServletRequest?

Can it be done with the AsyncMiddleManServlet?

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
Novaax
  • 77
  • 1
  • 5
  • Check out the following link. https://stackoverflow.com/questions/39767239/how-to-change-the-http-response-content-length-header-in-java-filter – joemokenela Jul 16 '20 at 08:31
  • Sorry but the posted link doesen´t help. Because there is described how to edit the HttpServletResponse not the HttpServletRequest! – Novaax Jul 16 '20 at 08:40
  • Change it why? It is up to the client to define the content-length of the request. It doesn't make sense for the server to change it, unless it also changes the content. – user207421 Jul 16 '20 at 10:06
  • I need to change the Length of the Content because the Body is changed. – Novaax Jul 16 '20 at 10:35

1 Answers1

0

If you use the AsyncMiddleManServlet properly, then the Content-Length request header will be appropriately adjusted.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • How do i use the AsyncMiddleManServlet properly? There is no Tutorial or help in the Internet. – Novaax Jul 16 '20 at 11:41