Compare commits

...

3 Commits

Author SHA1 Message Date
yhirose 80c0cc445e Release v0.15.2 2024-02-02 23:29:30 -05:00
yhirose 762024b890 Fix #1768 2024-02-02 23:17:32 -05:00
yhirose 82a90a2325 Update year 2024-01-29 08:53:01 -05:00
3 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -866,7 +866,7 @@ NOTE: Windows 8 or lower, Visual Studio 2013 or lower, and Cygwin and MSYS2 incl
License
-------
MIT license (© 2023 Yuji Hirose)
MIT license (© 2024 Yuji Hirose)
Special Thanks To
-----------------
+7 -3
View File
@@ -1,14 +1,14 @@
//
// httplib.h
//
// Copyright (c) 2023 Yuji Hirose. All rights reserved.
// Copyright (c) 2024 Yuji Hirose. All rights reserved.
// MIT License
//
#ifndef CPPHTTPLIB_HTTPLIB_H
#define CPPHTTPLIB_HTTPLIB_H
#define CPPHTTPLIB_VERSION "0.15.1"
#define CPPHTTPLIB_VERSION "0.15.2"
/*
* Configuration
@@ -2417,7 +2417,11 @@ inline bool is_valid_path(const std::string &path) {
// Read component
auto beg = i;
while (i < path.size() && path[i] != '/') {
if (path[i] == '\0') { return false; }
if (path[i] == '\0') {
return false;
} else if (path[i] == '\\') {
return false;
}
i++;
}
+6
View File
@@ -2509,6 +2509,12 @@ TEST_F(ServerTest, GetMethodOutOfBaseDirMount2) {
EXPECT_EQ(StatusCode::NotFound_404, res->status);
}
TEST_F(ServerTest, GetMethodOutOfBaseDirMountWithBackslash) {
auto res = cli_.Get("/mount/%2e%2e%5c/www2/dir/test.html");
ASSERT_TRUE(res);
EXPECT_EQ(StatusCode::NotFound_404, res->status);
}
TEST_F(ServerTest, PostMethod303) {
auto res = cli_.Post("/1", "body", "text/plain");
ASSERT_TRUE(res);