Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#8980 closed defect (fixed)

dojox.rpc.Rest incorrectly adds trailing slash to target

Reported by: Jarrod Carlson Owned by: Kris Zyp
Priority: high Milestone: 1.4
Component: Dojox Version: 1.3.0b3
Keywords: Cc:
Blocked By: Blocking:

Description

I have a REST-based web service where resources are available.

Assume my services return Foo objects. Thusly,

http://domain.com/foos

returns a list of Foo objects, and

http://domain.com/foo/123

returns the Foo object with an id of '123'.

When I create a JsonRestStore? with a target of "/foos", the dojox.rpc.Rest implementation assumes itself to append a "/" to the target:

62    path = path.match(/\/$/) ? path : (path + '/');

However, my REST server does not support the url "http://domain.com/foos/". It should be "http://domain.com/foos".

dojox.rpc.Rest should not presume itself to add slashes to the target.

Change History (4)

comment:1 Changed 11 years ago by Adam Peller

Milestone: 1.3tbd
Owner: changed from Adam Peller to Kris Zyp

comment:2 Changed 11 years ago by Chris Mitchell

We're also seeing a need for flexibility on the trailing slash to allow connecting to projectzero's REST services.

comment:3 Changed 10 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

This should be fixed. By default trailing slashes are still added for backwards compatibility, but you can disable that by allowNoTrailingSlash to true: new dojox.data.JsonRestStore?({allowNoTrailingSlash: true, target:"/MyData"});

comment:4 Changed 10 years ago by Adam Peller

Milestone: tbd1.4
Note: See TracTickets for help on using tickets.