You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found in cpp-httplib v0.15.2 running on Windows 10 with Visual Studio 2022 (v143). Note: this behaviour has not been observed on Linux.
If a root mount point '/' is set before other mount points, then this prevents urls addressing the other mount points without a '/' at the end. For example:
curl -v 127.0.0.1/test results in a 200 OK. curl -v 127.0.0.1/test/ results in a 200 OK.
The problem lies in Server::handle_file_request where detail::is_file(path) is used. This uses _access_s for Windows which is for files or directories and is incorrect for this use(detail::is_dir() does not use this approach). The directory is then opened as a file which fails and hence the 404 response.
Found in
cpp-httplib
v0.15.2 running on Windows 10 with Visual Studio 2022 (v143). Note: this behaviour has not been observed on Linux.If a root mount point '/' is set before other mount points, then this prevents urls addressing the other mount points without a '/' at the end. For example:
curl -v 127.0.0.1/test
results in a404 Not Found
.curl -v 127.0.0.1/test/
results in a200 OK
.The workaround is to set the root mount point as the last entry:
curl -v 127.0.0.1/test
results in a200 OK
.curl -v 127.0.0.1/test/
results in a200 OK
.The problem lies in
Server::handle_file_request
wheredetail::is_file(path)
is used. This uses _access_s for Windows which is for files or directories and is incorrect for this use(detail::is_dir()
does not use this approach). The directory is then opened as a file which fails and hence the404
response.This may be linked to #1389.
The text was updated successfully, but these errors were encountered: