Skip to content

Commit c9257fa

Browse files
authored
Upgrade to ada 2.6.8, bump version to 1.4.1 (#35)
1 parent 74c9ab4 commit c9257fa

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

ada_url/ada.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-09-05 16:55:45 -0400. Do not edit! */
1+
/* auto-generated on 2023-09-19 16:48:25 -0400. Do not edit! */
22
/* begin file src/ada.cpp */
33
#include "ada.h"
44
/* begin file src/checkers.cpp */
@@ -11864,7 +11864,7 @@ bool url::set_host_or_hostname(const std::string_view input) {
1186411864
}
1186511865

1186611866
// Let host be the result of host parsing host_view with url is not special.
11867-
if (host_view.empty()) {
11867+
if (host_view.empty() && !is_special()) {
1186811868
host = "";
1186911869
return true;
1187011870
}
@@ -13625,13 +13625,12 @@ bool url_aggregator::set_host_or_hostname(const std::string_view input) {
1362513625
// empty string, and either url includes credentials or url's port is
1362613626
// non-null, return.
1362713627
else if (host_view.empty() &&
13628-
(is_special() || has_credentials() ||
13629-
components.port != url_components::omitted)) {
13628+
(is_special() || has_credentials() || has_port())) {
1363013629
return false;
1363113630
}
1363213631

1363313632
// Let host be the result of host parsing host_view with url is not special.
13634-
if (host_view.empty()) {
13633+
if (host_view.empty() && !is_special()) {
1363513634
if (has_hostname()) {
1363613635
clear_hostname(); // easy!
1363713636
} else if (has_dash_dot()) {

ada_url/ada.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-09-05 16:55:45 -0400. Do not edit! */
1+
/* auto-generated on 2023-09-19 16:48:25 -0400. Do not edit! */
22
/* begin file include/ada.h */
33
/**
44
* @file ada.h
@@ -1055,9 +1055,10 @@ inline constexpr bool is_normalized_windows_drive_letter(
10551055
return input.size() >= 2 && (is_alpha(input[0]) && (input[1] == ':'));
10561056
}
10571057

1058-
ada_really_inline constexpr bool begins_with(std::string_view view,
1059-
std::string_view prefix) {
1058+
ada_really_inline bool begins_with(std::string_view view,
1059+
std::string_view prefix) {
10601060
// in C++20, you have view.begins_with(prefix)
1061+
// std::equal is constexpr in C++20
10611062
return view.size() >= prefix.size() &&
10621063
std::equal(prefix.begin(), prefix.end(), view.begin());
10631064
}
@@ -5020,10 +5021,10 @@ inline constexpr bool is_normalized_windows_drive_letter(
50205021
std::string_view input) noexcept;
50215022

50225023
/**
5023-
* @warning Will be removed when Ada supports C++20.
5024+
* @warning Will be removed when Ada requires C++20.
50245025
*/
5025-
ada_really_inline constexpr bool begins_with(std::string_view view,
5026-
std::string_view prefix);
5026+
ada_really_inline bool begins_with(std::string_view view,
5027+
std::string_view prefix);
50275028

50285029
/**
50295030
* Returns true if an input is an ipv4 address.
@@ -6557,7 +6558,9 @@ inline bool url_aggregator::has_hostname() const noexcept {
65576558

65586559
inline bool url_aggregator::has_port() const noexcept {
65596560
ada_log("url_aggregator::has_port");
6560-
return components.pathname_start != components.host_end;
6561+
// A URL cannot have a username/password/port if its host is null or the empty
6562+
// string, or its scheme is "file".
6563+
return has_hostname() && components.pathname_start != components.host_end;
65616564
}
65626565

65636566
inline bool url_aggregator::has_dash_dot() const noexcept {
@@ -6926,14 +6929,14 @@ inline void url_search_params::sort() {
69266929
#ifndef ADA_ADA_VERSION_H
69276930
#define ADA_ADA_VERSION_H
69286931

6929-
#define ADA_VERSION "2.6.7"
6932+
#define ADA_VERSION "2.6.8"
69306933

69316934
namespace ada {
69326935

69336936
enum {
69346937
ADA_VERSION_MAJOR = 2,
69356938
ADA_VERSION_MINOR = 6,
6936-
ADA_VERSION_REVISION = 7,
6939+
ADA_VERSION_REVISION = 8,
69376940
};
69386941

69396942
} // namespace ada

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = ada-url
3-
version = 1.4.0
3+
version = 1.4.1
44
description = 'URL parser and manipulator based on the WHAT WG URL standard'
55
long_description = file: README.rst
66
long_description_content_type = text/x-rst

0 commit comments

Comments
 (0)