From 13f6f7d8f5e696ca6cca74a40919c40d6687b2d4 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 16 Nov 2025 18:43:53 -0800 Subject: [PATCH] fix url --- weed/s3api/s3api_object_handlers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 302aab8bc..68490c877 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -1344,14 +1344,15 @@ func (s3a *S3ApiServer) fetchChunkViewData(ctx context.Context, chunkView *filer return nil, fmt.Errorf("failed to lookup chunk %s: %w", chunkView.FileId, err) } - // Use the first URL + // Use the first URL (already contains complete URL with fileId) chunkUrl := urlStrings[0] // Generate JWT for volume server authentication jwt := security.GenJwtForVolumeServer(s3a.filerGuard.ReadSigningKey, s3a.filerGuard.ReadExpiresAfterSec, chunkView.FileId) // Create request with Range header for the chunk view - req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://%s/%s", chunkUrl, chunkView.FileId), nil) + // chunkUrl already contains the complete URL including fileId + req, err := http.NewRequestWithContext(ctx, "GET", chunkUrl, nil) if err != nil { return nil, fmt.Errorf("failed to create request: %w", err) }