Escape dots in URL regexes

This commit is contained in:
blankie 2023-04-04 18:09:55 +07:00
parent ba0fb29573
commit 5850bc7e6c
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 3 additions and 3 deletions

View File

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