You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess changing the bahaviour of appendPathComponent to appending one path segment is not an option. But it should be documented that appendPathComponent is not appending a RFC 3986 path segment but a partial path.
I think pathComponents and lastPathComponent should be changed: Both must not decode "%2F" before splitting the path.
I would love to see appendPathSegment(_ segment: String) on URL.
URL’s pathComponents could be settable.
URLComponents could include a settable pathSegements.
CharacterSet could include a urlPathSegmentAllowed.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 7c361480bdc90db77c2604de02f281d0
Issue Description:
When using
appendPathComponent
to add a path segment that contains a slash, behaviour ofappendPathComponent
andlastPathComponent
is inconsistent:Actual result:
Expected result:
Escaping the segment using
String
’saddPercentEncoding
with a custom variant ofCharacterSet.urlPathAllowed
without “/” does not work either:Results in:
URLComponents
path fails with the same result:The only workaround I found was to build the URL string by hand, the using
URL(string🙂
This still leaveslastPathComponent
incorrect:Resulting in:
TL;DR:
I guess changing the bahaviour of
appendPathComponent
to appending one path segment is not an option. But it should be documented thatappendPathComponent
is not appending a RFC 3986 path segment but a partial path.I think
pathComponents
andlastPathComponent
should be changed: Both must not decode "%2F" before splitting the path.I would love to see
appendPathSegment(_ segment: String)
onURL
.URL’s
pathComponents
could be settable.URLComponents
could include a settablepathSegements
.CharacterSet
could include aurlPathSegmentAllowed
.The text was updated successfully, but these errors were encountered: