Skip to content

Commit

Permalink
Rename isNotSpecial argument to is_opaque in the parse_host
Browse files Browse the repository at this point in the history
  • Loading branch information
rmisev committed Sep 20, 2023
1 parent 76e4704 commit 712f806
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[WHATWG URL Standard](https://url.spec.whatwg.org/) compliant **U**RL **pa**rser library in C++.

This library is up to date with the URL Standard published on
[26 July 2023 (commit fff33c3)](https://url.spec.whatwg.org/commit-snapshots/fff33c343f01575c691bba6cdeeefb9d09e792a9/).
[20 September 2023 (commit 9057992)](https://url.spec.whatwg.org/commit-snapshots/9057992dd6a050fb8af01fffb4d3c9df1ab89b70/).

## API

Expand Down
8 changes: 4 additions & 4 deletions include/upa/url_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class host_output {
class host_parser {
public:
template <typename CharT>
static url_result parse_host(const CharT* first, const CharT* last, bool isNotSpecial, host_output& dest);
static url_result parse_host(const CharT* first, const CharT* last, bool is_opaque, host_output& dest);

template <typename CharT>
static url_result parse_opaque_host(const CharT* first, const CharT* last, host_output& dest);
Expand Down Expand Up @@ -141,7 +141,7 @@ static inline bool contains_forbidden_host_char(const CharT* first, const CharT*
// https://url.spec.whatwg.org/#concept-host-parser

template <typename CharT>
inline url_result host_parser::parse_host(const CharT* first, const CharT* last, bool isNotSpecial, host_output& dest) {
inline url_result host_parser::parse_host(const CharT* first, const CharT* last, bool is_opaque, host_output& dest) {
using UCharT = typename std::make_unsigned<CharT>::type;

// 1. Non-"file" special URL's cannot have an empty host.
Expand All @@ -154,7 +154,7 @@ inline url_result host_parser::parse_host(const CharT* first, const CharT* last,
// set empty host
dest.hostStart();
dest.hostDone(HostType::Empty);
return isNotSpecial ? url_result::Ok : url_result::EmptyHost;
return is_opaque ? url_result::Ok : url_result::EmptyHost;
}
assert(first < last);

Expand All @@ -166,7 +166,7 @@ inline url_result host_parser::parse_host(const CharT* first, const CharT* last,
return url_result::InvalidIpv6Address;
}

if (isNotSpecial)
if (is_opaque)
return parse_opaque_host(first, last, dest);

// Is ASCII domain?
Expand Down

0 comments on commit 712f806

Please sign in to comment.