[Spice-devel] [spice-gtk] Unescape SpiceSession::uri component by component
Christophe Fergeau
cfergeau at redhat.com
Thu Sep 20 03:34:51 PDT 2012
On Thu, Sep 20, 2012 at 12:03:12PM +0200, Hans de Goede wrote:
> Hi,
>
> On 09/20/2012 11:53 AM, Christophe Fergeau wrote:
> >Unescaping the whole URI and then parsing it is dangerous as
> >the unescaping may (for example) add some extra '/' in the URI
> >which are not part of a path. It's better to do the unescaping later
> >once the URI has been split in separate components.
> >This commit unescapes the path, host and query values. Handling escaped
> >query values is important for usernames/passwords which might contain
> >chars which are invalid in URIs.
> >If the host is enclosed in [], it's intentionally not escaped as this
> >contains an ipv6 URI, and may contain a %zone_id (see RFC4007). This is
> >consistent with libvirt/libxml2 behaviour, not with what gvfs does.
>
> You declare, set, and free an unescaped_path variable, but you don't
> seem to use it anywhere ?
Yes, 'path' is parsed but unused:
/* Break up the URI into its various parts, scheme, authority,
* path (ignored)
Since it's already parsed and unused, I've unescaped too in case it becomes
used one day. I'm fine with dropping this bit from the patch.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120920/79a40679/attachment.pgp>
More information about the Spice-devel
mailing list