User avatar
Bjorn_Andersson
GpsGate
Posts: 466
Joined: Wed Jun 28, 2006 5:20 pm
Location: Sweden
Contact: Website

FIX: A potentially dangerous Request

Wed May 29, 2013 4:07 pm

Note: for an updated version of this and other articles, we recommend you to check our knowledge base here

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 direcory in GpsGateServer installation.
By default it is found here: c:\GpsGateServer\IIS\web.config

Open the web.config file using a text editor. e.g. notepad.
Find this section:

Code: Select all

  <system.web>
    <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.


Within the <system.web> section add:

Code: Select all

  <httpRuntime requestValidationMode="2.0"/>
The whole section should look like this now:

Code: Select all

  <system.web>
    <httpModules>
      <add type="Franson.HttpModules.UrlRewriter" name="UrlRewriter" />
      <add type="Franson.Web.GZipHttpModule" name="GZipHttpModule" />
    </httpModules>
    <httpRuntime requestValidationMode="2.0"/>
  </system.web>
Save the file.

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

Return to “GpsGate Server - How to setup and use”