[API] Java SDK double slash bug with arvados-controller
We found the origin of the problem with the java SDK, the bug is in the new API server or the SDK, you decide. The SDK will query URLs with a double forward slash: https://$ARVADOS_API_HOST//arvados/v1/collections. The old Arvados would perform these queries, bu the new one issue a redirect (301). We fixed it by removing this line: https://github.com/curoverse/arvados/blob/master/sdk/java/src/main/java/org/arvados/sdk/Arvados.java#L94
That's the new arvados-controller component being more strict.
We should remove this line a publish a new package.
Tom Morris wrote:
Actually, the correct fix is to fix the server so that it isn't breaking existing clients.
Continuing to tolerate client bugs that were tolerated before should be easy enough here. But the buggy client should still be fixed. API endpoints are "/arvados/...", not "//arvados/...".
Tom Clegg wrote:
I wonder why f0d62ea064d32b980f723e37972788cbd693c2ff didn't fix this. Merged Fri Jul 13 2018.
That "fix path transparently" bit doesn't apply to GET reqs, because following a 301 redirect doesn't change the request method. If a client simply can't handle redirects, even GET requests fail.
I think it's OK to say clients need to be able to follow 301 redirects -- especially clients that aren't paying attention to the paths specified in the discovery doc.
The best fix would be to make Java SDK follow redirects, and fix that broken path to avoid the extra request.