Skip to content

Fix percent-encoded fragment modification in Poco::URI#2959

Merged
obiltschnig merged 1 commit intopocoproject:develfrom
dahek:get_raw_fragment
Jul 3, 2022
Merged

Fix percent-encoded fragment modification in Poco::URI#2959
obiltschnig merged 1 commit intopocoproject:develfrom
dahek:get_raw_fragment

Conversation

@dahek
Copy link
Copy Markdown

@dahek dahek commented Mar 18, 2020

Before this commit using Poco::URI class to parse specific URIs that had
percent-encoded fragment identifier resulted in the loss of information
concerning the way the fragment identifier was encoded. There could be the cases
when the result of Poco::URI object serialization to string did not match the
original URI string Poco::URI object was created from.

In this commit we change the internal logic of fragment processing in Poco::URI,
so that the fragment is stored inside the class in raw form (the same way as
query string). The methods getFragment and setFragment work the old way (with
percent-decoded fragment values), new methods getRawFragment and setRawFragment
are added to get access to the original fragment representation.

Before this commit using Poco::URI class to parse specific URIs that had
percent-encoded fragment identifier resulted in the loss of information
concerning the way the fragment identifier was encoded. There could be the cases
when the  result of Poco::URI object serialization to string did not match the
original URI string Poco::URI object was created from.

In this commit we change the internal logic of fragment processing in Poco::URI,
so that the fragment is stored inside the class in raw form (the same way as
query string). The methods getFragment and setFragment work the old way (with
percent-decoded fragment values), new methods getRawFragment and setRawFragment
are added to get access to the original fragment representation.
@obiltschnig obiltschnig self-assigned this Mar 18, 2020
@obiltschnig obiltschnig added this to the Release 1.11.0 milestone Mar 18, 2020
@aleks-f
Copy link
Copy Markdown
Member

aleks-f commented May 29, 2022

@obiltschnig this is a breaking change - getFragment() would now returns const std::string&, so that would now be a reference to a temporary object for code that was retrieving it as reference

@obiltschnig obiltschnig merged commit b6dcb5b into pocoproject:devel Jul 3, 2022
@matejk matejk added stale and removed pending labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants