Forum Discussion

Mohanad_313515's avatar
Mohanad_313515
Icon for Nimbostratus rankNimbostratus
May 16, 2018

iRule for disallow Request Content-Length in the header from being sent

Hello All,

 

I'm facing this issue "Request Content-Length differs from actual request body length"

 

I have contact with the dev team, they have a workaround to disallow this value in the header from being sent, can I do the same on the BIG-IP via iRule?

 

1 Reply

  • It's better if the dev team fix their code to send the correct content length value.

     

    If that's not possible, you can disable the violation from your ASM blocking settings.

     

    Removing the header via irule might trigger other violations.

     

    But you can also recalculate the length in an iRule:

     

    when HTTP_REQUEST {
        if { [HTTP::method] eq "POST" } {
            HTTP::collect
        }
    }
    when HTTP_REQUEST_DATA {
        HTTP::header replace Content-Length [HTTP::payload length]
    }