可以在这样的 URL 路径中使用未编码的 @/at 符号吗?
https://example.com/User/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c1b5a4b2b581a4b9a0acb1ada4efa2aeac" rel="noreferrer noopener nofollow">[email protected]</a>
预编码,它将是 https://example.com/User/test%40example.com
,人类可读性较差。
似乎都可以在主要浏览器中工作 - 想知道是否存在会导致问题的情况。
最佳答案
查看 RFC 3986 中的“pchar”ABNF 规则 ( http://greenbytes.de/tech/webdav/rfc3986.html#path ):
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
所以,是的,“@”是允许的,不需要转义。
关于http - @(at) 符号是否需要编码在 URL 路径中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22999841/