403 Response on POST Request

As part of our Web Application Firewall we occasionally filter invalid POST requests when we detect malicious traffic towards our network.

This shouldn't cause any problems with software that is using standard HTTP POST requests to reach your website. However, if you've written a custom application you will need to ensure the code making the POST is setting the appropriate Content-Length header in the request.

curl/libcurl will do this by default if you send any HTTP POST data. But if your custom code is simply overriding the HTTP method to POST without setting/sending any data, this header may be missing and result in the block.

You can easily resolve this by setting this header manually, for example:curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Length: ' . strlen($fields)));

However, it may be easier to simply use the built-in POST fields which automatically populate this header as required.

curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);

  • 0 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

What version of Windows do you run on the Windows servers?

Our Windows servers run using Windows 2016 R. These servers are based on the same specification...

Providing Access Logs to a Third-Party provider

Some third-party providers may request access logs for investigation (i.e. Google AdWords). You...

Can I enable HSTS?

The HTTP Strict-Transport-Security response header (often abbreviated as HSTS) lets a website...

Does your Windows hosting support .NET Core?

Windows hosting doesn't support the .NET Core framework. However, if you would like to...

Can I block visitors by country?

You can block access to your websites by country or IP address.  Head to Hostrite > Manage...

Powered by WHMCompleteSolution