Skip to content
Merged
Show file tree
Hide file tree
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
changed the function name
  • Loading branch information
lemire committed Oct 16, 2024
commit 958289ff0e1a44aec4f2a83db6e9c0fa0c8451a9
4 changes: 2 additions & 2 deletions include/ada/url_aggregator-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1110,9 +1110,9 @@ inline std::ostream &operator<<(std::ostream &out,
return out << u.to_string();
}

void url_aggregator::set_host_to_base_host(
void url_aggregator::update_host_to_base_host(
const std::string_view input) noexcept {
ada_log("url_aggregator::set_host_to_base_host ", input);
ada_log("url_aggregator::update_host_to_base_host ", input);
ADA_ASSERT_TRUE(validate());
ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer));
if (type != ada::scheme::type::FILE) {
Expand Down
2 changes: 1 addition & 1 deletion include/ada/url_aggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ struct url_aggregator : url_base {
std::string_view new_scheme_with_colon) noexcept;
inline void copy_scheme(const url_aggregator &u) noexcept;

inline void set_host_to_base_host(const std::string_view input) noexcept;
inline void update_host_to_base_host(const std::string_view input) noexcept;

}; // url_aggregator

Expand Down
8 changes: 4 additions & 4 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ result_type parse_url_impl(std::string_view user_input,
} else {
url.update_base_authority(base_url->get_href(),
base_url->get_components());
url.set_host_to_base_host(base_url->get_hostname());
url.update_host_to_base_host(base_url->get_hostname());
url.update_base_port(base_url->retrieve_base_port());
// cloning the base path includes cloning the has_opaque_path flag
url.has_opaque_path = base_url->has_opaque_path;
Expand Down Expand Up @@ -495,7 +495,7 @@ result_type parse_url_impl(std::string_view user_input,
} else {
url.update_base_authority(base_url->get_href(),
base_url->get_components());
url.set_host_to_base_host(base_url->get_hostname());
url.update_host_to_base_host(base_url->get_hostname());
url.update_base_port(base_url->retrieve_base_port());
}
state = ada::state::PATH;
Expand Down Expand Up @@ -732,7 +732,7 @@ result_type parse_url_impl(std::string_view user_input,
if constexpr (result_type_is_ada_url) {
url.host = base_url->host;
} else {
url.set_host_to_base_host(base_url->get_host());
url.update_host_to_base_host(base_url->get_host());
}
// If the code point substring from pointer to the end of input does
// not start with a Windows drive letter and base's path[0] is a
Expand Down Expand Up @@ -843,7 +843,7 @@ result_type parse_url_impl(std::string_view user_input,
url.path = base_url->path;
url.query = base_url->query;
} else {
url.set_host_to_base_host(base_url->get_hostname());
url.update_host_to_base_host(base_url->get_hostname());
url.update_base_pathname(base_url->get_pathname());
url.update_base_search(base_url->get_search());
}
Expand Down