File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 5
5
#include " ada.h"
6
6
#include " ada/implementation.h"
7
7
#include " ada/helpers.h"
8
+ #include " ada/scheme.h"
8
9
9
10
#include < algorithm>
10
11
#include < string>
@@ -22,7 +23,10 @@ namespace ada {
22
23
if (non_special_scheme == " blob" ) {
23
24
if (!path.empty ()) {
24
25
auto result = ada::parse<ada::url>(path);
25
- if (result && result->is_special ()) {
26
+ if (result &&
27
+ (result->type == scheme::HTTP || result->type == scheme::HTTPS)) {
28
+ // If pathURL’s scheme is not "http" and not "https", then return a
29
+ // new opaque origin.
26
30
return ada::helpers::concat (result->get_protocol (), " //" ,
27
31
result->get_host ());
28
32
}
Original file line number Diff line number Diff line change @@ -634,7 +634,9 @@ bool url_aggregator::set_hostname(const std::string_view input) {
634
634
std::string_view path = get_pathname ();
635
635
if (!path.empty ()) {
636
636
auto out = ada::parse<ada::url_aggregator>(path);
637
- if (out && out->is_special ()) {
637
+ if (out && (out->type == scheme::HTTP || out->type == scheme::HTTPS)) {
638
+ // If pathURL’s scheme is not "http" and not "https", then return a
639
+ // new opaque origin.
638
640
return helpers::concat (out->get_protocol (), " //" , out->get_host ());
639
641
}
640
642
}
You can’t perform that action at this time.
0 commit comments