guodongxiaren commented on a change in pull request #1506:
URL: https://github.com/apache/incubator-brpc/pull/1506#discussion_r683555938



##########
File path: src/brpc/uri.cpp
##########
@@ -98,6 +102,20 @@ inline const char* SplitHostAndPort(const char* host_begin,
     return host_end;
 }
 
+// valid characters in URL
+// 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
+static bool is_valid_char(const char* p) {
+    static const std::unordered_set<char> other_valid_char = {
+        ':', '/', '?', '#', '[', ']', '@', '!', '$', '&',
+        '\'', '(', ')'/ '*', '+', ',', ';', '='/ '-', '.',

Review comment:
       改了。另外发现这里要补一个空格,否则已有的单例会有失败。因为brpc之前允许url里有空格,有skip逻辑

##########
File path: src/brpc/uri.cpp
##########
@@ -98,6 +102,20 @@ inline const char* SplitHostAndPort(const char* host_begin,
     return host_end;
 }
 
+// valid characters in URL
+// 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
+static bool is_valid_char(const char* p) {
+    static const std::unordered_set<char> other_valid_char = {
+        ':', '/', '?', '#', '[', ']', '@', '!', '$', '&',
+        '\'', '(', ')'/ '*', '+', ',', ';', '='/ '-', '.',

Review comment:
       改了。另外发现这里要补一个空格,否则已有的单例会有失败。因为brpc之前允许url里有空格,有skip逻辑。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to