mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-17 10:59:39 +00:00
reserving before encoding (#912)
This commit is contained in:
1 parent
7c60e69c33
commit
c58b00580e
1 file changed
+2
-1
@@ -1612,7 +1612,8 @@ inline std::string encode_query_param(const std::string &value) {
|
|||||||
|
|
||||||
inline std::string encode_url(const std::string &s) {
|
inline std::string encode_url(const std::string &s) {
|
||||||
std::string result;
|
std::string result;
|
||||||
|
result.reserve(s.size());
|
||||||
|
|
||||||
for (size_t i = 0; s[i]; i++) {
|
for (size_t i = 0; s[i]; i++) {
|
||||||
switch (s[i]) {
|
switch (s[i]) {
|
||||||
case ' ': result += "%20"; break;
|
case ' ': result += "%20"; break;
|
||||||
|
|||||||
Reference in new issue
Block a user