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
In URI version 5.10, if a file name is provided that has leading and or trailing spaces, those will be removed since URI::file::Base::new() calls URI->new to generate the object, and URI explicitly states it removes leading and trailing spaces.
Yes, exactly what I was referring to. I can understand the need to remove leading and trailing space for web URI, but for file URI, I doubt it. Wikipedia page seems to indicate they should not, at least on Windows.
The section on file URI syntax of the original rfc3986 indicates the segments should contain percent-encoded characters to represent the spaces: "A percent-encoding mechanism is used to represent a data octet in a component when that octet's corresponding character is outside the allowed set or is being used as a delimiter of, or within, the component"[1]
In URI version 5.10, if a file name is provided that has leading and or trailing spaces, those will be removed since
URI::file::Base::new()
callsURI->new
to generate the object, andURI
explicitly states it removes leading and trailing spaces.See code below as an example:
This will yield something like:
whereas, it should return:
file:///home/joe/%20some%20file%20
and
$u->file
should return' some file '
The mitigation is to set back the path after the object has been instantiated, such as:
which would correctly yield
'/home/joe/ some file '
The text was updated successfully, but these errors were encountered: