尝试查询包含“&"的安全组名称.会引发以下错误:-从客户端(& 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 (&).
问题描述
我正在面对这个问题,我无法在内部部署共享点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:-but i am getting this error:-
/_api/web/sitegroups/getbyname('User & Workers')/users/
A potentially dangerous Request.Path value was detected from the client (&).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:-
where the
url = "/_api/web/sitegroups/getbyname(" + "'" + FieldValue + "')/users/"; $.ajax({ url: url, method: "GET", async: false, headers: { "Accept": "application/json; odata=verbose" }, success: function (data) {FieldValue
will be equal toUser & 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="<,>,*,%,:,\,?" requestValidationMode="2.0" />
Here is one thread for your reference.
Best Regards,
Lee
这篇关于尝试查询包含“&"的安全组名称.会引发以下错误:-从客户端(& amp;)检测到潜在的Request.Path值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文