Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
Daniel Lemire committed Dec 20, 2024
commit e5a4ef446ee1b5bc6704a4dbf51cdca89dc2d4dd
10 changes: 4 additions & 6 deletions src/url_pattern.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "ada.h"

#include <algorithm>
#include <iostream>
#include <optional>
#include <regex>
#include <string>
Expand Down Expand Up @@ -728,17 +727,16 @@ bool protocol_component_matches_special_scheme(std::string_view input) {
std::regex rx(input.data(), input.size());
std::cmatch cmatch;
return std::regex_match("http", cmatch, rx) ||
std::regex_match("https", cmatch, rx) ||
std::regex_match("ws", cmatch, rx) ||
std::regex_match("wss", cmatch, rx) ||
std::regex_match("ftp", cmatch, rx);
std::regex_match("https", cmatch, rx) ||
std::regex_match("ws", cmatch, rx) ||
std::regex_match("wss", cmatch, rx) ||
std::regex_match("ftp", cmatch, rx);
} catch (...) {
// You probably want to log this error.
ada_log("Error while matching protocol component with special scheme");
ada_log("Regex Input: ", input);
return false;
}

}

} // namespace url_pattern_helpers
Expand Down