mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
deps: update ada to 2.9.0
PR-URL: https://github.com/nodejs/node/pull/53748 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
parent
74ddce8853
commit
bb7fc653e9
190
deps/ada/ada.cpp
vendored
190
deps/ada/ada.cpp
vendored
|
|
@ -1,7 +1,8 @@
|
||||||
/* auto-generated on 2024-05-30 22:24:57 -0400. Do not edit! */
|
/* auto-generated on 2024-07-06 17:38:56 -0400. Do not edit! */
|
||||||
/* begin file src/ada.cpp */
|
/* begin file src/ada.cpp */
|
||||||
#include "ada.h"
|
#include "ada.h"
|
||||||
/* begin file src/checkers.cpp */
|
/* begin file src/checkers.cpp */
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace ada::checkers {
|
namespace ada::checkers {
|
||||||
|
|
@ -9794,6 +9795,10 @@ ADA_POP_DISABLE_WARNINGS
|
||||||
|
|
||||||
namespace ada::unicode {
|
namespace ada::unicode {
|
||||||
|
|
||||||
|
constexpr bool is_tabs_or_newline(char c) noexcept {
|
||||||
|
return c == '\r' || c == '\n' || c == '\t';
|
||||||
|
}
|
||||||
|
|
||||||
constexpr uint64_t broadcast(uint8_t v) noexcept {
|
constexpr uint64_t broadcast(uint8_t v) noexcept {
|
||||||
return 0x101010101010101ull * v;
|
return 0x101010101010101ull * v;
|
||||||
}
|
}
|
||||||
|
|
@ -9828,13 +9833,8 @@ ada_really_inline bool has_tabs_or_newline(
|
||||||
std::string_view user_input) noexcept {
|
std::string_view user_input) noexcept {
|
||||||
// first check for short strings in which case we do it naively.
|
// first check for short strings in which case we do it naively.
|
||||||
if (user_input.size() < 16) { // slow path
|
if (user_input.size() < 16) { // slow path
|
||||||
for (size_t i = 0; i < user_input.size(); i++) {
|
return std::any_of(user_input.begin(), user_input.end(),
|
||||||
if (user_input[i] == '\r' || user_input[i] == '\n' ||
|
is_tabs_or_newline);
|
||||||
user_input[i] == '\t') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// fast path for long strings (expected to be common)
|
// fast path for long strings (expected to be common)
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
@ -9872,13 +9872,8 @@ ada_really_inline bool has_tabs_or_newline(
|
||||||
std::string_view user_input) noexcept {
|
std::string_view user_input) noexcept {
|
||||||
// first check for short strings in which case we do it naively.
|
// first check for short strings in which case we do it naively.
|
||||||
if (user_input.size() < 16) { // slow path
|
if (user_input.size() < 16) { // slow path
|
||||||
for (size_t i = 0; i < user_input.size(); i++) {
|
return std::any_of(user_input.begin(), user_input.end(),
|
||||||
if (user_input[i] == '\r' || user_input[i] == '\n' ||
|
is_tabs_or_newline);
|
||||||
user_input[i] == '\t') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// fast path for long strings (expected to be common)
|
// fast path for long strings (expected to be common)
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
@ -10263,10 +10258,6 @@ std::string percent_encode(const std::string_view input,
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string to_unicode(std::string_view input) {
|
|
||||||
return ada::idna::to_unicode(input);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace ada::unicode
|
} // namespace ada::unicode
|
||||||
/* end file src/unicode.cpp */
|
/* end file src/unicode.cpp */
|
||||||
/* begin file src/serializers.cpp */
|
/* begin file src/serializers.cpp */
|
||||||
|
|
@ -10359,7 +10350,8 @@ namespace ada {
|
||||||
template <class result_type>
|
template <class result_type>
|
||||||
ada_warn_unused tl::expected<result_type, ada::errors> parse(
|
ada_warn_unused tl::expected<result_type, ada::errors> parse(
|
||||||
std::string_view input, const result_type* base_url) {
|
std::string_view input, const result_type* base_url) {
|
||||||
result_type u = ada::parser::parse_url<result_type>(input, base_url);
|
result_type u =
|
||||||
|
ada::parser::parse_url_impl<result_type, true>(input, base_url);
|
||||||
if (!u.is_valid) {
|
if (!u.is_valid) {
|
||||||
return tl::unexpected(errors::generic_error);
|
return tl::unexpected(errors::generic_error);
|
||||||
}
|
}
|
||||||
|
|
@ -10395,16 +10387,22 @@ std::string href_from_file(std::string_view input) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool can_parse(std::string_view input, const std::string_view* base_input) {
|
bool can_parse(std::string_view input, const std::string_view* base_input) {
|
||||||
ada::result<ada::url_aggregator> base;
|
ada::url_aggregator base_aggregator;
|
||||||
ada::url_aggregator* base_pointer = nullptr;
|
ada::url_aggregator* base_pointer = nullptr;
|
||||||
|
|
||||||
if (base_input != nullptr) {
|
if (base_input != nullptr) {
|
||||||
base = ada::parse<url_aggregator>(*base_input);
|
base_aggregator = ada::parser::parse_url_impl<ada::url_aggregator, false>(
|
||||||
if (!base) {
|
*base_input, nullptr);
|
||||||
|
if (!base_aggregator.is_valid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
base_pointer = &base.value();
|
base_pointer = &base_aggregator;
|
||||||
}
|
}
|
||||||
return ada::parse<url_aggregator>(input, base_pointer).has_value();
|
|
||||||
|
ada::url_aggregator result =
|
||||||
|
ada::parser::parse_url_impl<ada::url_aggregator, false>(input,
|
||||||
|
base_pointer);
|
||||||
|
return result.is_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
ada_warn_unused std::string to_string(ada::encoding_type type) {
|
ada_warn_unused std::string to_string(ada::encoding_type type) {
|
||||||
|
|
@ -12139,11 +12137,12 @@ bool url::set_href(const std::string_view input) {
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
|
||||||
namespace ada::parser {
|
namespace ada::parser {
|
||||||
|
|
||||||
template <class result_type>
|
template <class result_type, bool store_values>
|
||||||
result_type parse_url(std::string_view user_input,
|
result_type parse_url_impl(std::string_view user_input,
|
||||||
const result_type* base_url) {
|
const result_type* base_url) {
|
||||||
// We can specialize the implementation per type.
|
// We can specialize the implementation per type.
|
||||||
// Important: result_type_is_ada_url is evaluated at *compile time*. This
|
// Important: result_type_is_ada_url is evaluated at *compile time*. This
|
||||||
// means that doing if constexpr(result_type_is_ada_url) { something } else {
|
// means that doing if constexpr(result_type_is_ada_url) { something } else {
|
||||||
|
|
@ -12178,7 +12177,7 @@ result_type parse_url(std::string_view user_input,
|
||||||
if (!url.is_valid) {
|
if (!url.is_valid) {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
if constexpr (result_type_is_ada_url_aggregator) {
|
if constexpr (result_type_is_ada_url_aggregator && store_values) {
|
||||||
// Most of the time, we just need user_input.size().
|
// Most of the time, we just need user_input.size().
|
||||||
// In some instances, we may need a bit more.
|
// In some instances, we may need a bit more.
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
|
|
@ -12195,9 +12194,6 @@ result_type parse_url(std::string_view user_input,
|
||||||
helpers::leading_zeroes(uint32_t(1 | user_input.size()))) +
|
helpers::leading_zeroes(uint32_t(1 | user_input.size()))) +
|
||||||
1;
|
1;
|
||||||
url.reserve(reserve_capacity);
|
url.reserve(reserve_capacity);
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
std::string tmp_buffer;
|
std::string tmp_buffer;
|
||||||
std::string_view internal_input;
|
std::string_view internal_input;
|
||||||
|
|
@ -12420,32 +12416,36 @@ result_type parse_url(std::string_view user_input,
|
||||||
password_token_seen =
|
password_token_seen =
|
||||||
password_token_location != std::string_view::npos;
|
password_token_location != std::string_view::npos;
|
||||||
|
|
||||||
if (!password_token_seen) {
|
if constexpr (store_values) {
|
||||||
if constexpr (result_type_is_ada_url) {
|
if (!password_token_seen) {
|
||||||
url.username += unicode::percent_encode(
|
if constexpr (result_type_is_ada_url) {
|
||||||
authority_view, character_sets::USERINFO_PERCENT_ENCODE);
|
url.username += unicode::percent_encode(
|
||||||
|
authority_view,
|
||||||
|
character_sets::USERINFO_PERCENT_ENCODE);
|
||||||
|
} else {
|
||||||
|
url.append_base_username(unicode::percent_encode(
|
||||||
|
authority_view,
|
||||||
|
character_sets::USERINFO_PERCENT_ENCODE));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
url.append_base_username(unicode::percent_encode(
|
if constexpr (result_type_is_ada_url) {
|
||||||
authority_view, character_sets::USERINFO_PERCENT_ENCODE));
|
url.username += unicode::percent_encode(
|
||||||
}
|
authority_view.substr(0, password_token_location),
|
||||||
} else {
|
character_sets::USERINFO_PERCENT_ENCODE);
|
||||||
if constexpr (result_type_is_ada_url) {
|
url.password += unicode::percent_encode(
|
||||||
url.username += unicode::percent_encode(
|
authority_view.substr(password_token_location + 1),
|
||||||
authority_view.substr(0, password_token_location),
|
character_sets::USERINFO_PERCENT_ENCODE);
|
||||||
character_sets::USERINFO_PERCENT_ENCODE);
|
} else {
|
||||||
url.password += unicode::percent_encode(
|
url.append_base_username(unicode::percent_encode(
|
||||||
authority_view.substr(password_token_location + 1),
|
authority_view.substr(0, password_token_location),
|
||||||
character_sets::USERINFO_PERCENT_ENCODE);
|
character_sets::USERINFO_PERCENT_ENCODE));
|
||||||
} else {
|
url.append_base_password(unicode::percent_encode(
|
||||||
url.append_base_username(unicode::percent_encode(
|
authority_view.substr(password_token_location + 1),
|
||||||
authority_view.substr(0, password_token_location),
|
character_sets::USERINFO_PERCENT_ENCODE));
|
||||||
character_sets::USERINFO_PERCENT_ENCODE));
|
}
|
||||||
url.append_base_password(unicode::percent_encode(
|
|
||||||
authority_view.substr(password_token_location + 1),
|
|
||||||
character_sets::USERINFO_PERCENT_ENCODE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else if constexpr (store_values) {
|
||||||
if constexpr (result_type_is_ada_url) {
|
if constexpr (result_type_is_ada_url) {
|
||||||
url.password += unicode::percent_encode(
|
url.password += unicode::percent_encode(
|
||||||
authority_view, character_sets::USERINFO_PERCENT_ENCODE);
|
authority_view, character_sets::USERINFO_PERCENT_ENCODE);
|
||||||
|
|
@ -12472,8 +12472,10 @@ result_type parse_url(std::string_view user_input,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (end_of_authority == input_size) {
|
if (end_of_authority == input_size) {
|
||||||
if (fragment.has_value()) {
|
if constexpr (store_values) {
|
||||||
url.update_unencoded_base_hash(*fragment);
|
if (fragment.has_value()) {
|
||||||
|
url.update_unencoded_base_hash(*fragment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
@ -12670,19 +12672,22 @@ result_type parse_url(std::string_view user_input,
|
||||||
}
|
}
|
||||||
case ada::state::QUERY: {
|
case ada::state::QUERY: {
|
||||||
ada_log("QUERY ", helpers::substring(url_data, input_position));
|
ada_log("QUERY ", helpers::substring(url_data, input_position));
|
||||||
// Let queryPercentEncodeSet be the special-query percent-encode set if
|
if constexpr (store_values) {
|
||||||
// url is special; otherwise the query percent-encode set.
|
// Let queryPercentEncodeSet be the special-query percent-encode set
|
||||||
const uint8_t* query_percent_encode_set =
|
// if url is special; otherwise the query percent-encode set.
|
||||||
url.is_special() ? ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE
|
const uint8_t* query_percent_encode_set =
|
||||||
: ada::character_sets::QUERY_PERCENT_ENCODE;
|
url.is_special()
|
||||||
|
? ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE
|
||||||
|
: ada::character_sets::QUERY_PERCENT_ENCODE;
|
||||||
|
|
||||||
// Percent-encode after encoding, with encoding, buffer, and
|
// Percent-encode after encoding, with encoding, buffer, and
|
||||||
// queryPercentEncodeSet, and append the result to url's query.
|
// queryPercentEncodeSet, and append the result to url's query.
|
||||||
url.update_base_search(helpers::substring(url_data, input_position),
|
url.update_base_search(helpers::substring(url_data, input_position),
|
||||||
query_percent_encode_set);
|
query_percent_encode_set);
|
||||||
ada_log("QUERY update_base_search completed ");
|
ada_log("QUERY update_base_search completed ");
|
||||||
if (fragment.has_value()) {
|
if (fragment.has_value()) {
|
||||||
url.update_unencoded_base_hash(*fragment);
|
url.update_unencoded_base_hash(*fragment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
@ -12785,9 +12790,11 @@ result_type parse_url(std::string_view user_input,
|
||||||
// Optimization: Avoiding going into PATH state improves the
|
// Optimization: Avoiding going into PATH state improves the
|
||||||
// performance of urls ending with /.
|
// performance of urls ending with /.
|
||||||
if (input_position == input_size) {
|
if (input_position == input_size) {
|
||||||
url.update_base_pathname("/");
|
if constexpr (store_values) {
|
||||||
if (fragment.has_value()) {
|
url.update_base_pathname("/");
|
||||||
url.update_unencoded_base_hash(*fragment);
|
if (fragment.has_value()) {
|
||||||
|
url.update_unencoded_base_hash(*fragment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
@ -12833,11 +12840,13 @@ result_type parse_url(std::string_view user_input,
|
||||||
} else {
|
} else {
|
||||||
input_position = input_size + 1;
|
input_position = input_size + 1;
|
||||||
}
|
}
|
||||||
if constexpr (result_type_is_ada_url) {
|
if constexpr (store_values) {
|
||||||
helpers::parse_prepared_path(view, url.type, url.path);
|
if constexpr (result_type_is_ada_url) {
|
||||||
} else {
|
helpers::parse_prepared_path(view, url.type, url.path);
|
||||||
url.consume_prepared_path(view);
|
} else {
|
||||||
ADA_ASSERT_TRUE(url.validate());
|
url.consume_prepared_path(view);
|
||||||
|
ADA_ASSERT_TRUE(url.validate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -13031,17 +13040,29 @@ result_type parse_url(std::string_view user_input,
|
||||||
ada::unreachable();
|
ada::unreachable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fragment.has_value()) {
|
if constexpr (store_values) {
|
||||||
url.update_unencoded_base_hash(*fragment);
|
if (fragment.has_value()) {
|
||||||
|
url.update_unencoded_base_hash(*fragment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template url parse_url_impl(std::string_view user_input,
|
||||||
|
const url* base_url = nullptr);
|
||||||
|
template url_aggregator parse_url_impl(
|
||||||
|
std::string_view user_input, const url_aggregator* base_url = nullptr);
|
||||||
|
|
||||||
|
template <class result_type>
|
||||||
|
result_type parse_url(std::string_view user_input,
|
||||||
|
const result_type* base_url) {
|
||||||
|
return parse_url_impl<result_type, true>(user_input, base_url);
|
||||||
|
}
|
||||||
|
|
||||||
template url parse_url<url>(std::string_view user_input,
|
template url parse_url<url>(std::string_view user_input,
|
||||||
const url* base_url = nullptr);
|
const url* base_url = nullptr);
|
||||||
template url_aggregator parse_url<url_aggregator>(
|
template url_aggregator parse_url<url_aggregator>(
|
||||||
std::string_view user_input, const url_aggregator* base_url = nullptr);
|
std::string_view user_input, const url_aggregator* base_url = nullptr);
|
||||||
|
|
||||||
} // namespace ada::parser
|
} // namespace ada::parser
|
||||||
/* end file src/parser.cpp */
|
/* end file src/parser.cpp */
|
||||||
/* begin file src/url_components.cpp */
|
/* begin file src/url_components.cpp */
|
||||||
|
|
@ -15397,6 +15418,15 @@ void ada_search_params_sort(ada_url_search_params result) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ada_search_params_reset(ada_url_search_params result, const char* input,
|
||||||
|
size_t length) {
|
||||||
|
ada::result<ada::url_search_params>& r =
|
||||||
|
*(ada::result<ada::url_search_params>*)result;
|
||||||
|
if (r) {
|
||||||
|
r->reset(std::string_view(input, length));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ada_search_params_append(ada_url_search_params result, const char* key,
|
void ada_search_params_append(ada_url_search_params result, const char* key,
|
||||||
size_t key_length, const char* value,
|
size_t key_length, const char* value,
|
||||||
size_t value_length) {
|
size_t value_length) {
|
||||||
|
|
|
||||||
54
deps/ada/ada.h
vendored
54
deps/ada/ada.h
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
/* auto-generated on 2024-05-30 22:24:57 -0400. Do not edit! */
|
/* auto-generated on 2024-07-06 17:38:56 -0400. Do not edit! */
|
||||||
/* begin file include/ada.h */
|
/* begin file include/ada.h */
|
||||||
/**
|
/**
|
||||||
* @file ada.h
|
* @file ada.h
|
||||||
|
|
@ -1855,6 +1855,9 @@ inline int fast_digit_count(uint32_t x) noexcept {
|
||||||
#ifndef ADA_PARSER_H
|
#ifndef ADA_PARSER_H
|
||||||
#define ADA_PARSER_H
|
#define ADA_PARSER_H
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
/* begin file include/ada/expected.h */
|
/* begin file include/ada/expected.h */
|
||||||
/**
|
/**
|
||||||
* @file expected.h
|
* @file expected.h
|
||||||
|
|
@ -4377,9 +4380,6 @@ void swap(expected<T, E> &lhs,
|
||||||
#endif
|
#endif
|
||||||
/* end file include/ada/expected.h */
|
/* end file include/ada/expected.h */
|
||||||
|
|
||||||
#include <optional>
|
|
||||||
#include <string_view>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
|
|
@ -4393,7 +4393,6 @@ struct url;
|
||||||
* @brief Includes the definitions for supported parsers
|
* @brief Includes the definitions for supported parsers
|
||||||
*/
|
*/
|
||||||
namespace ada::parser {
|
namespace ada::parser {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a url. The parameter user_input is the input to be parsed:
|
* Parses a url. The parameter user_input is the input to be parsed:
|
||||||
* it should be a valid UTF-8 string. The parameter base_url is an optional
|
* it should be a valid UTF-8 string. The parameter base_url is an optional
|
||||||
|
|
@ -4409,6 +4408,14 @@ extern template url_aggregator parse_url<url_aggregator>(
|
||||||
extern template url parse_url<url>(std::string_view user_input,
|
extern template url parse_url<url>(std::string_view user_input,
|
||||||
const url* base_url);
|
const url* base_url);
|
||||||
|
|
||||||
|
template <typename result_type = ada::url_aggregator, bool store_values = true>
|
||||||
|
result_type parse_url_impl(std::string_view user_input,
|
||||||
|
const result_type* base_url = nullptr);
|
||||||
|
|
||||||
|
extern template url_aggregator parse_url_impl<url_aggregator>(
|
||||||
|
std::string_view user_input, const url_aggregator* base_url);
|
||||||
|
extern template url parse_url_impl<url>(std::string_view user_input,
|
||||||
|
const url* base_url);
|
||||||
} // namespace ada::parser
|
} // namespace ada::parser
|
||||||
|
|
||||||
#endif // ADA_PARSER_H
|
#endif // ADA_PARSER_H
|
||||||
|
|
@ -4613,12 +4620,6 @@ namespace ada::unicode {
|
||||||
bool to_ascii(std::optional<std::string>& out, std::string_view plain,
|
bool to_ascii(std::optional<std::string>& out, std::string_view plain,
|
||||||
size_t first_percent);
|
size_t first_percent);
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
* @see https://www.unicode.org/reports/tr46/#ToUnicode
|
|
||||||
*/
|
|
||||||
std::string to_unicode(std::string_view input);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* Checks if the input has tab or newline characters.
|
* Checks if the input has tab or newline characters.
|
||||||
|
|
@ -4795,10 +4796,10 @@ constexpr bool to_lower_ascii(char* input, size_t length) noexcept;
|
||||||
#ifndef ADA_URL_AGGREGATOR_H
|
#ifndef ADA_URL_AGGREGATOR_H
|
||||||
#define ADA_URL_AGGREGATOR_H
|
#define ADA_URL_AGGREGATOR_H
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
|
|
||||||
namespace ada {
|
namespace ada {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -4992,6 +4993,11 @@ struct url_aggregator : url_base {
|
||||||
std::string_view, const ada::url_aggregator *);
|
std::string_view, const ada::url_aggregator *);
|
||||||
friend void ada::helpers::strip_trailing_spaces_from_opaque_path<
|
friend void ada::helpers::strip_trailing_spaces_from_opaque_path<
|
||||||
ada::url_aggregator>(ada::url_aggregator &url) noexcept;
|
ada::url_aggregator>(ada::url_aggregator &url) noexcept;
|
||||||
|
friend ada::url_aggregator ada::parser::parse_url_impl<
|
||||||
|
ada::url_aggregator, true>(std::string_view, const ada::url_aggregator *);
|
||||||
|
friend ada::url_aggregator
|
||||||
|
ada::parser::parse_url_impl<ada::url_aggregator, false>(
|
||||||
|
std::string_view, const ada::url_aggregator *);
|
||||||
|
|
||||||
std::string buffer{};
|
std::string buffer{};
|
||||||
url_components components{};
|
url_components components{};
|
||||||
|
|
@ -5227,7 +5233,6 @@ ada_really_inline constexpr bool verify_dns_length(
|
||||||
#ifndef ADA_URL_H
|
#ifndef ADA_URL_H
|
||||||
#define ADA_URL_H
|
#define ADA_URL_H
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
@ -5235,6 +5240,7 @@ ada_really_inline constexpr bool verify_dns_length(
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
|
|
||||||
namespace ada {
|
namespace ada {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5509,6 +5515,11 @@ struct url : url_base {
|
||||||
friend void ada::helpers::strip_trailing_spaces_from_opaque_path<ada::url>(
|
friend void ada::helpers::strip_trailing_spaces_from_opaque_path<ada::url>(
|
||||||
ada::url &url) noexcept;
|
ada::url &url) noexcept;
|
||||||
|
|
||||||
|
friend ada::url ada::parser::parse_url_impl<ada::url, true>(std::string_view,
|
||||||
|
const ada::url *);
|
||||||
|
friend ada::url_aggregator ada::parser::parse_url_impl<
|
||||||
|
ada::url_aggregator, true>(std::string_view, const ada::url_aggregator *);
|
||||||
|
|
||||||
inline void update_unencoded_base_hash(std::string_view input);
|
inline void update_unencoded_base_hash(std::string_view input);
|
||||||
inline void update_base_hostname(std::string_view input);
|
inline void update_base_hostname(std::string_view input);
|
||||||
inline void update_base_search(std::string_view input);
|
inline void update_base_search(std::string_view input);
|
||||||
|
|
@ -6976,6 +6987,14 @@ struct url_search_params {
|
||||||
inline auto back() const { return params.back(); }
|
inline auto back() const { return params.back(); }
|
||||||
inline auto operator[](size_t index) const { return params[index]; }
|
inline auto operator[](size_t index) const { return params[index]; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* Used to reset the search params to a new input.
|
||||||
|
* Used primarily for C API.
|
||||||
|
* @param input
|
||||||
|
*/
|
||||||
|
void reset(std::string_view input);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::pair<std::string, std::string> key_value_pair;
|
typedef std::pair<std::string, std::string> key_value_pair;
|
||||||
std::vector<key_value_pair> params{};
|
std::vector<key_value_pair> params{};
|
||||||
|
|
@ -7046,6 +7065,11 @@ namespace ada {
|
||||||
template <typename T, ada::url_search_params_iter_type Type>
|
template <typename T, ada::url_search_params_iter_type Type>
|
||||||
url_search_params url_search_params_iter<T, Type>::EMPTY;
|
url_search_params url_search_params_iter<T, Type>::EMPTY;
|
||||||
|
|
||||||
|
inline void url_search_params::reset(std::string_view input) {
|
||||||
|
params.clear();
|
||||||
|
initialize(input);
|
||||||
|
}
|
||||||
|
|
||||||
inline void url_search_params::initialize(std::string_view input) {
|
inline void url_search_params::initialize(std::string_view input) {
|
||||||
if (!input.empty() && input.front() == '?') {
|
if (!input.empty() && input.front() == '?') {
|
||||||
input.remove_prefix(1);
|
input.remove_prefix(1);
|
||||||
|
|
@ -7255,13 +7279,13 @@ url_search_params_entries_iter::next() {
|
||||||
#ifndef ADA_ADA_VERSION_H
|
#ifndef ADA_ADA_VERSION_H
|
||||||
#define ADA_ADA_VERSION_H
|
#define ADA_ADA_VERSION_H
|
||||||
|
|
||||||
#define ADA_VERSION "2.8.0"
|
#define ADA_VERSION "2.9.0"
|
||||||
|
|
||||||
namespace ada {
|
namespace ada {
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ADA_VERSION_MAJOR = 2,
|
ADA_VERSION_MAJOR = 2,
|
||||||
ADA_VERSION_MINOR = 8,
|
ADA_VERSION_MINOR = 9,
|
||||||
ADA_VERSION_REVISION = 0,
|
ADA_VERSION_REVISION = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
2
deps/ada/ada_c.h
vendored
2
deps/ada/ada_c.h
vendored
|
|
@ -151,6 +151,8 @@ ada_string ada_search_params_get(ada_url_search_params result, const char* key,
|
||||||
size_t key_length);
|
size_t key_length);
|
||||||
ada_strings ada_search_params_get_all(ada_url_search_params result,
|
ada_strings ada_search_params_get_all(ada_url_search_params result,
|
||||||
const char* key, size_t key_length);
|
const char* key, size_t key_length);
|
||||||
|
void ada_search_params_reset(ada_url_search_params result, const char* input,
|
||||||
|
size_t length);
|
||||||
ada_url_search_params_keys_iter ada_search_params_get_keys(
|
ada_url_search_params_keys_iter ada_search_params_get_keys(
|
||||||
ada_url_search_params result);
|
ada_url_search_params result);
|
||||||
ada_url_search_params_values_iter ada_search_params_get_values(
|
ada_url_search_params_values_iter ada_search_params_get_values(
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ void BindingData::DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
|
||||||
if (!out->set_hostname(input.ToStringView())) {
|
if (!out->set_hostname(input.ToStringView())) {
|
||||||
return args.GetReturnValue().Set(String::Empty(env->isolate()));
|
return args.GetReturnValue().Set(String::Empty(env->isolate()));
|
||||||
}
|
}
|
||||||
std::string result = ada::unicode::to_unicode(out->get_hostname());
|
std::string result = ada::idna::to_unicode(out->get_hostname());
|
||||||
|
|
||||||
args.GetReturnValue().Set(String::NewFromUtf8(env->isolate(),
|
args.GetReturnValue().Set(String::NewFromUtf8(env->isolate(),
|
||||||
result.c_str(),
|
result.c_str(),
|
||||||
|
|
@ -499,7 +499,7 @@ std::optional<std::string> FileURLToPath(Environment* env,
|
||||||
// about percent encoding because the URL parser will have
|
// about percent encoding because the URL parser will have
|
||||||
// already taken care of that for us. Note that this only
|
// already taken care of that for us. Note that this only
|
||||||
// causes IDNs with an appropriate `xn--` prefix to be decoded.
|
// causes IDNs with an appropriate `xn--` prefix to be decoded.
|
||||||
return "\\\\" + ada::unicode::to_unicode(hostname) + decoded_pathname;
|
return "\\\\" + ada::idna::to_unicode(hostname) + decoded_pathname;
|
||||||
}
|
}
|
||||||
|
|
||||||
char letter = decoded_pathname[1] | 0x20;
|
char letter = decoded_pathname[1] | 0x20;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user