fix: update UrlEncoder for http api

This commit is contained in:
mrmrfan 2018-12-04 16:16:35 +08:00
parent b09a066ed0
commit ae21e7dcd2
3 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ static const std::string UrlEncode(const std::string& s)
ret += ptr[i];
else if(int(ptr[i])==32)
ret += '+';
else if((int(ptr[i])!=10) && (int(ptr[i])!=11) && (int(ptr[i])!=13))
else if((int(ptr[i])!=9)&& (int(ptr[i])!=10) && (int(ptr[i])!=13))
{
char buf[5];
memset(buf,0,5);

View File

@ -31,7 +31,7 @@ class GstoreConnector {
$ret .= $c;
else if (ord($c)==32)
$ret .= "+";
else if (ord($c)!=10 and ord($c)!=11 and ord($c)!=13)
else if (ord($c)!=9 and ord($c)!=10 and ord($c)!=13)
$ret .= sprintf("%%%X", ord($c));
}
return $ret;

View File

@ -33,7 +33,7 @@ class GstoreConnector:
ret += c
elif (ord(c)>=256):
ret += chr(ord(c))
elif ((ord(c)!=10) and (ord(c)!=11) and (ord(c)!=13)):
elif ((ord(c)!=9) and (ord(c)!=10) and (ord(c)!=13)):
ret += "{}{:X}".format("%", ord(c))
return ret