Skip to content

Commit 3a3c708

Browse files
authored
Changes for version 1.22.0 (#108)
1 parent c4841a6 commit 3a3c708

File tree

4 files changed

+135
-8
lines changed

4 files changed

+135
-8
lines changed

ada_url/ada.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2025-03-10 13:14:56 -0400. Do not edit! */
1+
/* auto-generated on 2025-03-30 13:24:42 -0400. Do not edit! */
22
/* begin file src/ada.cpp */
33
#include "ada.h"
44
/* begin file src/checkers.cpp */
@@ -13334,10 +13334,18 @@ result_type parse_url_impl(std::string_view user_input,
1333413334
input_position = input_size + 1;
1333513335
}
1333613336
url.has_opaque_path = true;
13337+
1333713338
// This is a really unlikely scenario in real world. We should not seek
1333813339
// to optimize it.
13339-
url.update_base_pathname(unicode::percent_encode(
13340-
view, character_sets::C0_CONTROL_PERCENT_ENCODE));
13340+
if (view.ends_with(' ')) {
13341+
std::string modified_view =
13342+
std::string(view.begin(), view.end() - 1) + "%20";
13343+
url.update_base_pathname(unicode::percent_encode(
13344+
modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE));
13345+
} else {
13346+
url.update_base_pathname(unicode::percent_encode(
13347+
view, character_sets::C0_CONTROL_PERCENT_ENCODE));
13348+
}
1334113349
break;
1334213350
}
1334313351
case state::PORT: {

ada_url/ada.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2025-03-10 13:14:56 -0400. Do not edit! */
1+
/* auto-generated on 2025-03-30 13:24:42 -0400. Do not edit! */
22
/* begin file include/ada.h */
33
/**
44
* @file ada.h
@@ -5859,7 +5859,6 @@ tl::expected<url_pattern<regex_provider>, errors> parse_url_pattern_impl(
58595859
// TODO: Optimization opportunity.
58605860
if (scheme::is_special(*processed_init->protocol)) {
58615861
std::string_view port = processed_init->port.value();
5862-
helpers::trim_c0_whitespace(port);
58635862
if (std::to_string(scheme::get_special_port(*processed_init->protocol)) ==
58645863
port) {
58655864
processed_init->port->clear();
@@ -10503,14 +10502,14 @@ constructor_string_parser<regex_provider>::parse(std::string_view input) {
1050310502
#ifndef ADA_ADA_VERSION_H
1050410503
#define ADA_ADA_VERSION_H
1050510504

10506-
#define ADA_VERSION "3.2.1"
10505+
#define ADA_VERSION "3.2.2"
1050710506

1050810507
namespace ada {
1050910508

1051010509
enum {
1051110510
ADA_VERSION_MAJOR = 3,
1051210511
ADA_VERSION_MINOR = 2,
10513-
ADA_VERSION_REVISION = 1,
10512+
ADA_VERSION_REVISION = 2,
1051410513
};
1051510514

1051610515
} // namespace ada

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ada-url"
7-
version = "1.21.0"
7+
version = "1.22.0"
88
authors = [
99
{name = "Bo Bayles", email = "[email protected]"},
1010
]

tests/files/urltestdata.json

+120
Original file line numberDiff line numberDiff line change
@@ -3778,6 +3778,126 @@
37783778
"search": "",
37793779
"hash": ""
37803780
},
3781+
{
3782+
"input": "non-special:opaque ",
3783+
"base": null,
3784+
"href": "non-special:opaque",
3785+
"origin": "null",
3786+
"protocol": "non-special:",
3787+
"username": "",
3788+
"password": "",
3789+
"host": "",
3790+
"hostname": "",
3791+
"port": "",
3792+
"pathname": "opaque",
3793+
"search": "",
3794+
"hash": ""
3795+
},
3796+
{
3797+
"input": "non-special:opaque ?hi",
3798+
"base": null,
3799+
"href": "non-special:opaque %20?hi",
3800+
"origin": "null",
3801+
"protocol": "non-special:",
3802+
"username": "",
3803+
"password": "",
3804+
"host": "",
3805+
"hostname": "",
3806+
"port": "",
3807+
"pathname": "opaque %20",
3808+
"search": "?hi",
3809+
"hash": ""
3810+
},
3811+
{
3812+
"input": "non-special:opaque #hi",
3813+
"base": null,
3814+
"href": "non-special:opaque %20#hi",
3815+
"origin": "null",
3816+
"protocol": "non-special:",
3817+
"username": "",
3818+
"password": "",
3819+
"host": "",
3820+
"hostname": "",
3821+
"port": "",
3822+
"pathname": "opaque %20",
3823+
"search": "",
3824+
"hash": "#hi"
3825+
},
3826+
{
3827+
"input": "non-special:opaque x?hi",
3828+
"base": null,
3829+
"href": "non-special:opaque x?hi",
3830+
"origin": "null",
3831+
"protocol": "non-special:",
3832+
"username": "",
3833+
"password": "",
3834+
"host": "",
3835+
"hostname": "",
3836+
"port": "",
3837+
"pathname": "opaque x",
3838+
"search": "?hi",
3839+
"hash": ""
3840+
},
3841+
{
3842+
"input": "non-special:opaque x#hi",
3843+
"base": null,
3844+
"href": "non-special:opaque x#hi",
3845+
"origin": "null",
3846+
"protocol": "non-special:",
3847+
"username": "",
3848+
"password": "",
3849+
"host": "",
3850+
"hostname": "",
3851+
"port": "",
3852+
"pathname": "opaque x",
3853+
"search": "",
3854+
"hash": "#hi"
3855+
},
3856+
{
3857+
"input": "non-special:opaque \t\t \t#hi",
3858+
"base": null,
3859+
"href": "non-special:opaque %20#hi",
3860+
"origin": "null",
3861+
"protocol": "non-special:",
3862+
"username": "",
3863+
"password": "",
3864+
"host": "",
3865+
"hostname": "",
3866+
"port": "",
3867+
"pathname": "opaque %20",
3868+
"search": "",
3869+
"hash": "#hi"
3870+
},
3871+
{
3872+
"input": "non-special:opaque \t\t #hi",
3873+
"base": null,
3874+
"href": "non-special:opaque %20#hi",
3875+
"origin": "null",
3876+
"protocol": "non-special:",
3877+
"username": "",
3878+
"password": "",
3879+
"host": "",
3880+
"hostname": "",
3881+
"port": "",
3882+
"pathname": "opaque %20",
3883+
"search": "",
3884+
"hash": "#hi"
3885+
},
3886+
{
3887+
"input": "non-special:opaque\t\t \r #hi",
3888+
"base": null,
3889+
"href": "non-special:opaque %20#hi",
3890+
"origin": "null",
3891+
"protocol": "non-special:",
3892+
"username": "",
3893+
"password": "",
3894+
"host": "",
3895+
"hostname": "",
3896+
"port": "",
3897+
"pathname": "opaque %20",
3898+
"search": "",
3899+
"hash": "#hi"
3900+
},
37813901
"Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
37823902
{
37833903
"input": "http://www.foo。bar.com",

0 commit comments

Comments
 (0)