|
@@ -106,11 +106,12 @@ inline const char* SplitHostAndPort(const char* host_begin,
|
|
|
// https://datatracker.ietf.org/doc/html/rfc3986#section-2.1
|
|
|
// https://datatracker.ietf.org/doc/html/rfc3986#section-2.3
|
|
|
// https://datatracker.ietf.org/doc/html/rfc3986#section-2.4
|
|
|
+// space is not allowed by rfc3986, but allowed by brpc
|
|
|
static bool is_valid_char(const char* p) {
|
|
|
static const std::unordered_set<char> other_valid_char = {
|
|
|
':', '/', '?', '#', '[', ']', '@', '!', '$', '&',
|
|
|
'\'', '(', ')'/ '*', '+', ',', ';', '='/ '-', '.',
|
|
|
- '_', '~', '%'
|
|
|
+ '_', '~', '%', ' '
|
|
|
};
|
|
|
|
|
|
return (isalnum(*p) || other_valid_char.find(*p) != other_valid_char.end());
|