19889: Preserve WebDAV path when proxying to keep-web.
authorTom Clegg <tom@curii.com>
Tue, 28 Mar 2023 19:51:59 +0000 (15:51 -0400)
committerTom Clegg <tom@curii.com>
Tue, 28 Mar 2023 19:51:59 +0000 (15:51 -0400)
commitd7f388108615d981636e464785129ce4a958a7f5
treecf80d8c2d0a8548dc6847c99dae5d8eb299a741c
parente1d9921132ec1f414aba996609bab2f46384e413
19889: Preserve WebDAV path when proxying to keep-web.

WebDAV clients expect the path in the server response to match the
request.

Previously when proxying to keep-web we were rewriting the request
from /arvados/v1/containers/{uuid}/log/stderr.txt to
/by_id/{pdh}/stderr.txt, so the response referred to
/by_id/{pdh}/stderr.txt.

With this change, we leave the request path alone and use a new
X-Webdav-Prefix request header (/arvados/v1/containers/{uuid}/log in
this case) to tell keep-web to strip that part when accessing the
virtual filesystem.

New test uses cadaver, which fails on the previous version with

Could not access /arvados/v1/containers/zzzzz-dz642-queuedcontainer/log/ (not WebDAV-enabled?):
Did not find a collection resource.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
lib/controller/localdb/container_gateway.go
lib/controller/localdb/container_gateway_test.go
lib/controller/localdb/localdb_test.go
lib/controller/router/router.go
services/keep-web/handler.go