Why does the default setting for `requestPathInvalidCharacters` exclude otherwise-allowed characters?

天大地大妈咪最大 提交于 2019-12-05 16:50:53

问题


In ASP.NET, the httpRuntime/@requestPathInvalidCharacters attribute defaults to <,>,*,%,&,:,\. These characters, as I understand, are disallowed in the path portion of a URL (based on the default setting of this attribute), but some of them should be allowed. Out of that list, I struggle to understand why *,&,: are disallowed by default. E.g., the following URLs are valid but would be rejected by default by ASP.NET:

To get a unique person by email: http://myservice.com/People/Email=jim@smith.net

To get a unique locality within a state: http://myservice.com/States/VA/Localities/FIPS=001

I could also swap out the = for : to make ASP.NET reject the URL by default. But these characters/URLs are valid and should/do work fine.

So, does anyone have any insight into why these disallowed characters were chosen?

(Related post/answer: https://stackoverflow.com/a/13500078/374198)

来源:https://stackoverflow.com/questions/35653835/why-does-the-default-setting-for-requestpathinvalidcharacters-exclude-otherwis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!