From d66117b4fe2a456a46c5841465e175c4ece57717 Mon Sep 17 00:00:00 2001 From: Dominic Wong Date: Thu, 9 Dec 2021 16:45:51 +0000 Subject: [PATCH] Make url on space.read work with base url (#300) --- space/handler/space.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/space/handler/space.go b/space/handler/space.go index aa75d60..93b9073 100644 --- a/space/handler/space.go +++ b/space/handler/space.go @@ -355,6 +355,11 @@ func (s *Space) Read(ctx context.Context, req *api.Request, rsp *api.Response) e log.Errorf("Error presigning url %s", err) return errors.InternalServerError(method, "Error reading object") } + + // replace hostname or url with our base + split := strings.SplitN(urlStr, s.conf.Endpoint, 2) + urlStr = s.conf.BaseURL + split[1] + rsp.Header = map[string]*api.Pair{ "Location": { Key: "Location",