Escape dots in URL regexes
This commit is contained in:
parent
ba0fb29573
commit
5850bc7e6c
6
main.cpp
6
main.cpp
|
@ -24,9 +24,9 @@ int main(int argc, char** argv) {
|
|||
server.Get("/", [&](const httplib::Request& req, httplib::Response& res) {
|
||||
home_route(req, res, config);
|
||||
});
|
||||
server.Get("/style.css", css_route);
|
||||
server.Get("/style\\.css", css_route);
|
||||
|
||||
server.Get("/member.php", [&](const httplib::Request& req, httplib::Response& res) {
|
||||
server.Get("/member\\.php", [&](const httplib::Request& req, httplib::Response& res) {
|
||||
std::string id = req.get_param_value("id");
|
||||
if (id.empty() || id.find_first_not_of("1234567890") != std::string::npos) {
|
||||
res.status = 400;
|
||||
|
@ -35,7 +35,7 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
serve_redirect(req, res, config, get_origin(req, config) + "/users/" + id);
|
||||
});
|
||||
server.Get("/member_illust.php", [&](const httplib::Request& req, httplib::Response& res) {
|
||||
server.Get("/member_illust\\.php", [&](const httplib::Request& req, httplib::Response& res) {
|
||||
std::string illust_id = req.get_param_value("illust_id");
|
||||
if (illust_id.empty() || illust_id.find_first_not_of("1234567890") != std::string::npos) {
|
||||
res.status = 400;
|
||||
|
|
Loading…
Reference in New Issue