尝试查询包含“&"的安全组名称.会引发以下错误:-从客户端(& amp;)检测到潜在的Request.Path值. [英] Trying to query a security group name which contain "&" will raise the following error :- A potentially dangerous Request.Path value was detected from the client (&).

查看:59
本文介绍了尝试查询包含“&"的安全组名称.会引发以下错误:-从客户端(& amp;)检测到潜在的Request.Path值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在面对这个问题,我无法在内部部署共享点2013中找到解决方案.现在,我有一个名为"Users & Workers"的安全组.在我的JavaScript中,我正在查询此安全组,如下所示:-

这是firefox F12工具的代码:-

 <<> 

您可以在web.config中添加requestPathInvalidCharacters,以删除无效的&"字符,或改用/_api/Web/SiteGroups/GetById(27)/Users.

例如:

< maxRequestLength " " requestPathInvalidCharacters " ,>,*,%,:,\ ,? " requestValidationMode " "

这里有一个线程供您参考.

最好的问候,


I am facing this problem which i can not find a solution for inside my sharepoint on-premise 2013. now i have a security group named "Users & Workers" and inside my javascript i am querying this security group, as follow:-

/_api/web/sitegroups/getbyname('User & Workers')/users/ 

but i am getting this error:-

A potentially dangerous Request.Path value was detected from the client (&amp;).

i think the problem is related to the fact that the group name contain this character &. so is there a way to fix this ?

here is my JavaScript code which is responsible to do the call:-

url = "/_api/web/sitegroups/getbyname(" + "'" + FieldValue + "')/users/";
$.ajax({
     url: url,
     method: "GET",
     async: false,
     headers: { "Accept": "application/json; odata=verbose" },
     success: function (data) {

where the FieldValue will be equal to User & Workers

here is the code from firefox F12 tools:-

GET http://**/_api/web/sitegroups/getbyname('Users%20&%20Workers')/users/

400 Bad Request
        110ms   
jquery-1.10.2.js (line 8720)
"NetworkError: 400 Bad Request -



解决方案

Hi,

You could add requestPathInvalidCharacters in your web.config to remove ‘&’ as invalid character or use /_api/Web/SiteGroups/GetById(27)/Users instead.

For example:

<httpRuntime maxRequestLength="51200" requestPathInvalidCharacters="&lt;,>,*,%,:,\,?" requestValidationMode="2.0" />

Here is one thread for your reference.

https://stackoverflow.com/questions/14475913/url-routing-image-handler-a-potentially-dangerous-request-path-value

Best Regards,

Lee


这篇关于尝试查询包含“&amp;"的安全组名称.会引发以下错误:-从客户端(&amp; amp;)检测到潜在的Request.Path值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆