22124: Reject requests with double slash, except GET //locator. 22124-keepstore-double-slash
authorTom Clegg <tom@curii.com>
Mon, 23 Sep 2024 15:44:36 +0000 (11:44 -0400)
committerTom Clegg <tom@curii.com>
Mon, 23 Sep 2024 15:44:36 +0000 (11:44 -0400)
commitc81c3e3763835141da8e5d62de6550e97416f35a
treed32f4e1a6dbb4eec6c5202ac5b41fa3d28d42b26
parenteddc63eeb1389373c1f82ab0b503c2fc400231d3
22124: Reject requests with double slash, except GET //locator.

Previously we responded to "PUT //locator" with a 301 to a cleaned
path, which did not work because 301 tells clients to repeat the PUT
request as a GET.  Better to just respond 400, since this means the
client is broken or misconfigured.

There may be some clients that have been working successfully with the
301 redirect behavior because they only do GET and HEAD requests.  To
avoid breaking these, we continue to accept "GET //locator" -- but now
we just return the data instead of a redirect to "GET /locator".

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
services/keepstore/router.go
services/keepstore/router_test.go