mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net.urllib: change confusing name of internal method
This commit is contained in:
parent
2bdbc327d9
commit
7bf1c7f005
@ -432,7 +432,7 @@ pub fn parse(rawurl string) ?URL {
|
|||||||
p := split(rawurl, '#', true)
|
p := split(rawurl, '#', true)
|
||||||
u := p[0]
|
u := p[0]
|
||||||
frag := p[1]
|
frag := p[1]
|
||||||
mut url := parse_request_url(u, false) or {
|
mut url := _parse(u, false) or {
|
||||||
return error(error_msg(ParseError, u))
|
return error(error_msg(ParseError, u))
|
||||||
}
|
}
|
||||||
if frag == '' {
|
if frag == '' {
|
||||||
@ -451,14 +451,14 @@ pub fn parse(rawurl string) ?URL {
|
|||||||
// The string rawurl is assumed not to have a #fragment suffix.
|
// The string rawurl is assumed not to have a #fragment suffix.
|
||||||
// (Web browsers strip #fragment before sending the URL to a web server.)
|
// (Web browsers strip #fragment before sending the URL to a web server.)
|
||||||
fn parse_request_uri(rawurl string) ?URL {
|
fn parse_request_uri(rawurl string) ?URL {
|
||||||
return parse_request_url(rawurl, true)
|
return _parse(rawurl, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse parses a URL from a string in one of two contexts. If
|
// _parse parses a URL from a string in one of two contexts. If
|
||||||
// via_request is true, the URL is assumed to have arrived via an HTTP request,
|
// via_request is true, the URL is assumed to have arrived via an HTTP request,
|
||||||
// in which case only absolute URLs or path-absolute relative URLs are allowed.
|
// in which case only absolute URLs or path-absolute relative URLs are allowed.
|
||||||
// If via_request is false, all forms of relative URLs are allowed.
|
// If via_request is false, all forms of relative URLs are allowed.
|
||||||
fn parse_request_url(rawurl string, via_request bool) ?URL {
|
fn _parse(rawurl string, via_request bool) ?URL {
|
||||||
if string_contains_ctl_byte(rawurl) {
|
if string_contains_ctl_byte(rawurl) {
|
||||||
return error(error_msg('invalid control character in URL', rawurl))
|
return error(error_msg('invalid control character in URL', rawurl))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user