add wx code.
Some checks failed
Deploy / Build (push) Failing after 13s

This commit is contained in:
2025-06-04 18:07:46 +08:00
parent 0c7e06f3db
commit edab6cfa30
7 changed files with 563 additions and 9 deletions

View File

@ -4,7 +4,7 @@
#include <boost/beast/version.hpp>
#include <boost/config.hpp>
#include <boost/stacktrace.hpp>
#include <boost/url/parse_path.hpp>
#include <boost/url/parse.hpp>
#include <boost/url/url_view.hpp>
#include <iostream>
#include <limits>
@ -75,15 +75,15 @@ void HttpSession::onRead(const boost::beast::error_code &error, std::size_t) {
}
auto &request = m_parser->get();
auto path = boost::urls::parse_path(request.target());
auto path = boost::urls::parse_origin_form(request.target());
if (!path) {
LOG(error) << request.target() << "failed, error: " << path.error().message();
LOG(error) << request.target() << " failed, error: " << path.error().message();
errorReply(request, http::status::bad_request, "Illegal request-target");
return;
}
auto router = m_router.lock();
boost::urls::matches matches;
auto handler = router->find(*path, matches);
auto handler = router->find(path->encoded_segments(), matches);
if (handler) {
try {
(*handler)(*this, request, matches);