mirror of
https://github.com/Fishwaldo/minihttp.git
synced 2025-03-15 11:31:24 +00:00
Better urlencode compatibility
This commit is contained in:
parent
9227cc114a
commit
f5a04dd9d4
1 changed files with 2 additions and 1 deletions
|
@ -272,7 +272,8 @@ void URLEncode(const std::string& s, std::string& enc)
|
|||
{
|
||||
const unsigned char c = s[i];
|
||||
// from https://www.ietf.org/rfc/rfc1738.txt, page 3
|
||||
if(isalnum(c) || c == '$' || c == '-' || c == '_' || c == '.' || c == '+' || c == '!' || c == '*' || c == '\'' || c == '(' || c == ')' || c == ',')
|
||||
// with some changes for compatibility
|
||||
if(isalnum(c) || c == '-' || c == '_' || c == '.' || c == ',')
|
||||
enc += (char)c;
|
||||
else if(c == ' ')
|
||||
enc += '+';
|
||||
|
|
Loading…
Add table
Reference in a new issue