[Opensim-dev] Uris: Errors/Inconsistencies/TBD
Alan M Webb
alan_webb at us.ibm.com
Tue Sep 9 12:51:55 UTC 2008
Stefan
Consistency would be nice, but I think insensitivity would be better.
Can you give some specific examples, I trawled through the code but
couldn't be sure i was finding the code you have issue with.
In the REST code in ApplicationPlugins/Rest all inbound URL's are
canonicalized to eliminate any issues WRT trailing "/".
BTW as far as I can tell, The Uri class' ToString echoes whatever you
provide. If you don't supply a trailing slash when the URI is
created, then ToString does not generate one.
The ABNF in RFC 3986 (URI Generic Syntax) always shows "/" as a prefixing
notion - conversely, many of their textual examples indicate that a
trailing "/" is perfectly valid. I think this is an area where human
interaction will always produce either, and REST is certanly not limited
to machine-to-machine communications, so I do think we need to code this
is in a way that says it doesn't matter.
Best regards
Alan
-------------------
T.J. Watson Research Center, Hawthorne, NY
1-914-784-7286
alan_webb at us.ibm.com
Stefan Andersson <stefan at tribalmedia.se>
Sent by: opensim-dev-bounces at lists.berlios.de
09/09/2008 04:20 AM
Please respond to
opensim-dev at lists.berlios.de
To
<opensim-dev at lists.berlios.de>
cc
Subject
[Opensim-dev] Uris: Errors/Inconsistencies/TBD
Just a quick one,
I don't have time to fix this up, and I guess we should discuss it first;
the issue is that parts of the code presumes url segments _ends_ with '/'
and others they _begin_ with '/'
this leads to heavy confusion and easily done mistakes
now, the Uri class (which, together with UriBuilder, is poorly underused)
ToString _appends_ an '/'
which I consider the proper behaviour: all segments appends an '/' to show
they represent a hierarchy node.
I've already made the inventoryUrl wrapping an Uri to safeguard against
missing trailing '/' in the ini, which is/was one of our most common
mistakes, it seems. (and a bloody easy one at that)
Now, for example, the REST code, presumes the opposite
which means we can't combine the output of a Uri with the output from the
RestClient.
So I can't wrap the asset url the same way.
Which sucks.
Either way, I suggest we use postfix notation in accordance with Uri class
standard, but most of all I would want us to harmonize on one or the
other.
Discussions?
/Stefan
_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080909/35a4b46c/attachment-0001.html>
More information about the Opensim-dev
mailing list