A potentially dangerous Request. Path value was detected from the client exception solution, potentially

Source: Internet
Author: User

A potentially dangerous Request. Path value was detected from the client exception solution, potentially

Scenario:

When the URL contains A special character "<,>, *, %, &,:,/", the page throws A potentially dangerous Request. Path value was detected from the client exception.

 

Cause:

It is the default Interception Mechanism of ASP. NET to ensure the security of page URL transmission.

 

There are two solutions:

First, remove dangerous character verification for page requests directly:

Add the following code to the <system. web> node of the web. config configuration file:

1 <system.web>2    

 

Second, set which dangerous characters need to be verified:

1 <system.web>2     

Note that the requestPathInvalidCharacters is a list of invalid characters separated by commas. If this key-Value Pair does not exist by default, it means that the restricted invalid character set (separated by commas) is the seven: <,>, *, % ,&,:,/

If you want these characters to be unrestricted, set requestPathInvalidCharacters = "";

If you want to restrict some characters, you need to set the characters to be restricted in requestPathInvalidCharacters. For example, requestPathInvalidCharacters = "<,> ".

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.