A potentially dangerous request

mceclip0.png

Symptoms

When saving an event rule or other content in GpsGate Server containing HTML code.
You get A potentially dangerous Request.Form value was detected from the client error.

This issue affect users running .NET 4.0 as framework for the web application.
It also affects you running IIS Express since it only support version > 4.0

Fix

To fix this problem you need to add a few lines to the Web.config file Web.config if found in the IIS directory in GpsGateServer installation. 

By default, it is found here: c:\GpsGateServer\IIS\web.config.

Make a backup of the web.config file first.

1. Open the web.config file using a text editor. e.g. Notepad.

2. Find this section:


<system.web>
<customErrors mode="Off" />
<httpModules>
<add type="Franson.HttpModules.UrlRewriter" name="UrlRewriter" />
<add type="Franson.Web.GZipHttpModule" name="GZipHttpModule" />
</httpModules>
</system.web>

Note, the <system.web> section might not look exactly as in this example.

3. Within the <system.web> section add:

<httpRuntime requestValidationMode="2.0" maxRequestLength="1048576" executionTimeout="3600" /> 

The whole section should look like this now:

 <system.web>
<httpRuntime requestValidationMode="2.0" maxRequestLength="1048576" executionTimeout="3600" />
<customErrors mode="Off" />
<httpModules>
<add type="Franson.HttpModules.UrlRewriter" name="UrlRewriter" />
<add type="Franson.Web.GZipHttpModule" name="GZipHttpModule" />
</httpModules>
</system.web>

Screenshot 2023-08-24 at 11.02.08.png

4. Save the file.

5. Login to the platform in order to ensure that's up and running.

For more info see:
http://msdn.microsoft.com/en-us/library/hh882339%28v=vs.110%29.aspx