为什么我可能会在移动 chrome 而不是桌面 chrome 中收到双重转义序列错误?
Why might I get a double escape sequence error in mobile chrome but not desktop chrome?
当尝试在移动设备上从我的 angular 网页创建 ajax post 时,我收到以下错误:
The request contained a double escape sequence and request filtering is configured on the Web server to deny double escape sequences.
但是,当尝试从我的桌面创建相同的 post 时,post 按预期工作并且我没有收到任何错误。我已经在 chrome 和 IE 中测试过了。
这里是 ajax post 如果有帮助的话:
$scope.upload = $upload.upload({
url: baseApiAddress + 'mobile/' + customerPhone, //+ $scope.mobileId,
method: 'PUT',
file: file, // or list of files: files for html5 only
contentType: "application/json"
})
我可以通过将以下内容添加到我的 web.config
中来防止此错误:
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="True"/>
</security>
</system.webServer>
我正在阅读为什么这可能很危险 here。
为什么桌面上不存在此错误,但移动设备上会出现此错误?非常感谢您的宝贵时间。如果我不清楚或者您需要我提供任何其他信息,请告诉我。
我犯了一个错误,忘记了在用户的 phone 数字前面添加 +1
的函数,该函数后来用于构造 URL。 +
字符是导致 IIS 抛出双重转义错误的原因(更多信息 here and here)。一旦我删除了这个 +
字符,错误就不再出现了。这个错误在桌面版本中没有出现,因为我手动输入了 URL 并且在测试时没有添加 +
字符。
当尝试在移动设备上从我的 angular 网页创建 ajax post 时,我收到以下错误:
The request contained a double escape sequence and request filtering is configured on the Web server to deny double escape sequences.
但是,当尝试从我的桌面创建相同的 post 时,post 按预期工作并且我没有收到任何错误。我已经在 chrome 和 IE 中测试过了。
这里是 ajax post 如果有帮助的话:
$scope.upload = $upload.upload({
url: baseApiAddress + 'mobile/' + customerPhone, //+ $scope.mobileId,
method: 'PUT',
file: file, // or list of files: files for html5 only
contentType: "application/json"
})
我可以通过将以下内容添加到我的 web.config
中来防止此错误:
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="True"/>
</security>
</system.webServer>
我正在阅读为什么这可能很危险 here。
为什么桌面上不存在此错误,但移动设备上会出现此错误?非常感谢您的宝贵时间。如果我不清楚或者您需要我提供任何其他信息,请告诉我。
我犯了一个错误,忘记了在用户的 phone 数字前面添加 +1
的函数,该函数后来用于构造 URL。 +
字符是导致 IIS 抛出双重转义错误的原因(更多信息 here and here)。一旦我删除了这个 +
字符,错误就不再出现了。这个错误在桌面版本中没有出现,因为我手动输入了 URL 并且在测试时没有添加 +
字符。