Skip to content

Commit

Permalink
Allow hex for ipv6 literal addr in redirect (#1859)
Browse files Browse the repository at this point in the history
Co-authored-by: jaredhuang <[email protected]>
  • Loading branch information
zhlinh and jaredhuang committed Jun 17, 2024
1 parent 0b657d2 commit 9e4f93d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -7275,7 +7275,7 @@ inline bool ClientImpl::redirect(Request &req, Response &res, Error &error) {
if (location.empty()) { return false; }

const static std::regex re(
R"((?:(https?):)?(?://(?:\[([\d:]+)\]|([^:/?#]+))(?::(\d+))?)?([^?#]*)(\?[^#]*)?(?:#.*)?)");
R"((?:(https?):)?(?://(?:\[([a-fA-F\d:]+)\]|([^:/?#]+))(?::(\d+))?)?([^?#]*)(\?[^#]*)?(?:#.*)?)");

std::smatch m;
if (!std::regex_match(location, m, re)) { return false; }
Expand Down

0 comments on commit 9e4f93d

Please sign in to comment.