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



##########
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:
       / 现成的例子里是有的
   , 好像是没有。也可以加一个单测




-- 
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