Stop using cv2pdb and improve HTTP handling a little
This commit is contained in:
@@ -1143,6 +1143,24 @@ eng::string HttpParser::first_path_component(std::string_view defval) const {
|
||||
}
|
||||
}
|
||||
|
||||
eng::string HttpParser::to_lua_identifier(std::string_view pathcomp) {
|
||||
eng::ostringstream oss;
|
||||
for (char c : pathcomp) {
|
||||
if (sv::ascii_islower(c)) {
|
||||
oss << c;
|
||||
} else if (sv::ascii_isupper(c)) {
|
||||
oss << char(c + 'a' - 'A');
|
||||
} else if (sv::ascii_isdigit(c)) {
|
||||
oss << c;
|
||||
} else if ((c == '.') || (c == '_')) {
|
||||
oss << '_';
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
void HttpParser::fail(int code, std::string_view message) {
|
||||
status_ = code;
|
||||
error_ = message;
|
||||
|
||||
Reference in New Issue
Block a user