gpt4 book ai didi

url - URL 路径中包含多个句点的 URL 是否有效?

转载 作者:行者123 更新时间:2023-12-04 14:08:28 28 4
gpt4 key购买 nike

我想知道以下网址是否有效。

路径中的点,在主机之后:
http://www.example.com/v.b.w..com
主机中的点,作为子域的一部分:
http://v.b.w..co.manufacturer.example.com/

最佳答案

1. ..路径中有效 ( example.com/v.b.w..com ):
RFC 3986允许它,甚至在它的 abnormal examples 中列出它:

Within a representation with a well defined base URI of
http://a/b/c/d;p?q
a relative reference is transformed to its target URI as follows.

"g.." = "http://a/b/c/g.."
"..g" = "http://a/b/c/..g"
请注意 /../将无效,因为 URL 将被解释为具有相对部分 - 指向 a/b/../c 的链接就像一个链接到 a/c .
2. ..在子域中无效 ( http://no..bad.example.com ):
来自 RFC 1738 - Uniform Resource Locators (URL) , 第 5 节,特定 URL 方案的 BNF:
host           = hostname | hostnumber
hostname = *[ domainlabel "." ] toplabel
domainlabel = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit
token 之间只允许一个句点。

关于url - URL 路径中包含多个句点的 URL 是否有效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41821416/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com