mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Code cleanup
This commit is contained in:
parent
bc4a613b6d
commit
bf8fc11b53
1 changed files with 32 additions and 36 deletions
|
@ -2906,10 +2906,8 @@ inline bool parse_multipart_boundary(const std::string &content_type,
|
|||
return !boundary.empty();
|
||||
}
|
||||
|
||||
inline bool parse_range_header(const std::string &s, Ranges &ranges) {
|
||||
try {
|
||||
static auto re_first_range =
|
||||
std::regex(R"(bytes=(\d*-\d*(?:,\s*\d*-\d*)*))");
|
||||
inline bool parse_range_header(const std::string &s, Ranges &ranges) try {
|
||||
static auto re_first_range = std::regex(R"(bytes=(\d*-\d*(?:,\s*\d*-\d*)*))");
|
||||
std::smatch m;
|
||||
if (std::regex_match(s, m, re_first_range)) {
|
||||
auto pos = static_cast<size_t>(m.position(1));
|
||||
|
@ -2941,7 +2939,6 @@ inline bool parse_range_header(const std::string &s, Ranges &ranges) {
|
|||
}
|
||||
return false;
|
||||
} catch (...) { return false; }
|
||||
}
|
||||
|
||||
class MultipartFormDataParser {
|
||||
public:
|
||||
|
@ -4500,7 +4497,6 @@ inline bool Server::routing(Request &req, Response &res, Stream &strm) {
|
|||
|
||||
inline bool Server::dispatch_request(Request &req, Response &res,
|
||||
const Handlers &handlers) {
|
||||
|
||||
try {
|
||||
for (const auto &x : handlers) {
|
||||
const auto &pattern = x.first;
|
||||
|
|
Loading…
Reference in a new issue