mirror of
https://github.com/yhirose/cpp-httplib
synced 2026-06-08 18:30:49 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 80c0cc445e | |||
| 762024b890 | |||
| 82a90a2325 |
@@ -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
|
||||
-----------------
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user