net.http: fix a bug with ? in new_request

pull/11441/head
Alexander Medvednikov 2021-09-08 05:11:02 +03:00
parent 00433ba460
commit 577fedfce1
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ pub mut:
}
pub fn new_request(method Method, url_ string, data string) ?Request {
url := if method == .get { url_ + '?' + data } else { url_ }
url := if method == .get && !url_.contains('?') { url_ + '?' + data } else { url_ }
// println('new req() method=$method url="$url" dta="$data"')
return Request{
method: method