Skip to content

Commit

Permalink
Fix bug in URIPath assignment operator
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Dec 3, 2021
1 parent 5d84d4a commit 3018d03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/URI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ URIPath &URIPath::operator=(const URIPath &_path)
{
this->dataPtr->path = _path.dataPtr->path;
this->dataPtr->isAbsolute = _path.dataPtr->isAbsolute;
this->dataPtr->trailingSlash = _path.dataPtr->trailingSlash;
return *this;
}

Expand Down
4 changes: 2 additions & 2 deletions src/URI_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,8 @@ TEST(URITEST, HasAuthority)
// Modifyng path updates string
uri.Path() = URIPath("new_authority.com/another/path");

EXPECT_EQ("new_authority.com/another/path/", uri.Path().Str());
EXPECT_EQ("https://new_authority.com/another/path/", uri.Str());
EXPECT_EQ("new_authority.com/another/path", uri.Path().Str());
EXPECT_EQ("https://new_authority.com/another/path", uri.Str());

// Clearing keeps false authority
uri.Clear();
Expand Down

0 comments on commit 3018d03

Please sign in to comment.