[Spice-devel] [spice-gtk 2/5] session: Lookup URI query part before path part

Uri Lublin uril at redhat.com
Wed Jun 5 03:07:16 PDT 2013


On 06/05/2013 11:23 AM, Christophe Fergeau wrote:
> On Wed, Jun 05, 2013 at 11:15:47AM +0300, Uri Lublin wrote:
>> On 06/04/2013 05:19 PM, Christophe Fergeau wrote:
>>> When parsing an URI, spice_uri_parse currently first looks up for
>>> '/' to detect the 'path' part of the URI
>>> (http://foo.example.com/some/path) and then the query part (starting
>>> with '&' is looked up).
>>> However, this does not work as expected when the host name is not
>>> followed by a path, but the query part contains a path:
>>> http://foo.example.com&my_param=/some/path
>> Why is that syntax more simple/intuitive/expressive than the current
>> syntax ?
>> Isn't  "http://foo.example.com/?my_param=/some/path" equivalent ?
> Wrong commit log, the '&' was supposed to be a '?':
> http://foo.example.com?my_param=/some/path
> Is it typical to append a '/' to the end of the hostname as in your
> example?

I don't know if it's typical. It sets path to be empty.
I'm not sure what the purpose of path (for spice), currently it is ignored.
Maybe we should remove it.

In your example, query is "my_param=/some/path" and path points
to "/some/path" within query. Some may find it confusing, and it does not
follow URI syntax where path comes before query (IIUC).

However, I see that the URI created by spice_uri_create() is similar to your
example not mine.

Uri.



More information about the Spice-devel mailing list