Hi!

In my function as jcouchdb developer, I've been following the CouchDB development some time and found something that seems a little strange
to me.

There seem to have been multiple iterations how %2F is treated vs / in different access scenarios, with the current (0.10.0) behaviour seeming a little odd. First, there suddenly was a 301 response somewhere where it wasn't before. While accessing design documents, %2F using URLs get
redirected to / ones which makes the new apache http client 4.0 java lib
puke because it (rightfully, I think?) complains that it is receiving a redirect to the same URL which it interprets as endless loop thus being exception worthy.

I interpreted this finding as the 301 offering backwards compatibility
in some scenarios, but obviously I don't want jcouchdb driver to do
unescessary requests and I don't really like it following 30x automatically either (which it accidentally did because I forgot to disable that when switching from commons httpclient 3.x to 4.0).

Disabling 30x led to a situation where some unit tests failed (Design Doc accessing ones), so I fiddled around to find a combination that satisfied all tests. The solution I seemed to have found was to escape / into %2F but only if the document id does not start with the magic "_design/".

For reasons I can't seem to put my finger on, this behaviour seems weird.

Are my observations correct?
Is this the way to handle the issue?

Regards,
Sven Helmberger

Reply via email to