mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net: fix download_file (#10439)
This commit is contained in:
parent
2ff0f62866
commit
6e41561124
@ -74,7 +74,7 @@ pub fn (req &Request) do() ?Response {
|
|||||||
fn (req &Request) method_and_url_to_response(method Method, url urllib.URL) ?Response {
|
fn (req &Request) method_and_url_to_response(method Method, url urllib.URL) ?Response {
|
||||||
host_name := url.hostname()
|
host_name := url.hostname()
|
||||||
scheme := url.scheme
|
scheme := url.scheme
|
||||||
p := url.path.trim_left('/')
|
p := url.escaped_path().trim_left('/')
|
||||||
path := if url.query().len > 0 { '/$p?$url.query().encode()' } else { '/$p' }
|
path := if url.query().len > 0 { '/$p?$url.query().encode()' } else { '/$p' }
|
||||||
mut nport := url.port().int()
|
mut nport := url.port().int()
|
||||||
if nport == 0 {
|
if nport == 0 {
|
||||||
|
@ -649,7 +649,7 @@ pub fn (mut u URL) set_path(p string) ?bool {
|
|||||||
// their results.
|
// their results.
|
||||||
// In general, code should call escaped_path instead of
|
// In general, code should call escaped_path instead of
|
||||||
// reading u.raw_path directly.
|
// reading u.raw_path directly.
|
||||||
fn (u &URL) escaped_path() string {
|
pub fn (u &URL) escaped_path() string {
|
||||||
if u.raw_path != '' && valid_encoded_path(u.raw_path) {
|
if u.raw_path != '' && valid_encoded_path(u.raw_path) {
|
||||||
unescape(u.raw_path, .encode_path) or { return '' }
|
unescape(u.raw_path, .encode_path) or { return '' }
|
||||||
return u.raw_path
|
return u.raw_path
|
||||||
|
Loading…
Reference in New Issue
Block a user