f
http:foo → [""]
http:foo/ → [""]
http:foo// → ["", ""]
Size: a a a
f
http:foo → [""]
http:foo/ → [""]
http:foo// → ["", ""]
f
pub fn path_segments(&self) -> Option<str::Split<char>> {
let path = self.path();
if path.starts_with('/') {
Some(path[1..].split('/'))
} else {
None
}
}
💮
💮
💮
http://example.com
, то ты делаешь запрос GET / HTTP/1.1
.💮
http://example.com
и http://example.com/
один и тот же запрос.💮
http://example.com//
, то запрос будет GET // HTTP/1.1
.f
f
f
💮
custom://foo
) парсится как надо, вроде.f
custom://foo
) парсится как надо, вроде.c
f
custom://foo
) парсится как надо, вроде."custom:/foo" segments Some(["foo"]), path "/foo", host None
"custom:/foo/" segments Some(["foo", ""]), path "/foo/", host None
"custom:/foo//" segments Some(["foo", "", ""]), path "/foo//", host None
"custom://foo" segments None, path "", host Some(Domain("foo"))
"custom://foo/" segments Some([""]), path "/", host Some(Domain("foo"))
"custom://foo//" segments Some(["", ""]), path "//", host Some(Domain("foo"))
"custom:///foo" segments Some(["foo"]), path "/foo", host None
"custom:///foo/" segments Some(["foo", ""]), path "/foo/", host None
"custom:///foo//" segments Some(["foo", "", ""]), path "/foo//", host None
Dv
f
Dv
f