[Opensim-dev] REST handlers use partial string matching

Justin Clark-Casey jjustincc at googlemail.com
Tue Apr 1 17:59:57 UTC 2014


Hi Oren.  I believe the expected way to retrieve metadata (and effectively an existence check) for a resource in REST 
would be to send a HEAD request [1] to the url, rather than to have a separate endpoint.

I think changing the handling to exact matching is fine - I can't think why partial matching is done currently and I 
can't see how it makes sense in an HTTP context.  As far as I know nothing makes use of partial matching.

[1] 
http://books.google.co.uk/books?id=XUaErakHsoAC&pg=PA98&lpg=PA98&dq=restful+web+services+%22OPTIONS+method+lets%22&source=bl&ots=5jkmCnpNmy&sig=mXt_bcmXcZhoU6hFFm0L5j14IvE&hl=en&sa=X&ei=Hf06U--1E7GM7Aad2YHwAw&ved=0CDMQ6AEwAA#v=onepage&q=restful%20web%20services%20%22OPTIONS%20method%20lets%22&f=false

On 01/04/14 14:00, Oren Hurvitz wrote:
> I tried to add a REST handler at the endpoint "/assets_exist". It turns out
> that I can't do that, because REST handlers are searched using partial
> string matches, so servers that don't implement the new handler will
> mistakenly choose the "/assets" endpoint instead.
>
> For now, I solved the problem by using a different endpoint:
> "/get_assets_exist".
>
> For the future, I think that this should be changed so that only full string
> matches work. Otherwise each time a new handler is added it will have to
> find an endpoint name that isn't a prefix of any current endpoint -- a
> difficult and error-prone task. Before I do that, does anyone know of
> endpoints that rely on the current behavior (partial string matches)?
>
>
>
> --
> View this message in context: http://opensim-dev.2196679.n2.nabble.com/REST-handlers-use-partial-string-matching-tp7579119.html
> Sent from the opensim-dev mailing list archive at Nabble.com.
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>


-- 
Justin Clark-Casey (justincc)
OSVW Consulting
http://justincc.org
http://twitter.com/justincc



More information about the Opensim-dev mailing list