Skip to content

Commit e8a003d

Browse files
committed
incoming/web: always trim fileID in cancel handler
1 parent e8f7b6d commit e8a003d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/incoming/web/api_files.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ func (c *FilesController) CancelFileHandler(w http.ResponseWriter, r *http.Reque
193193
return
194194
}
195195

196+
// Remove .ach suffix if the request added it
197+
fileID = strings.TrimSuffix(fileID, ".ach")
198+
196199
ctx, span := telemetry.StartSpan(r.Context(), "cancel-file-handler", trace.WithAttributes(
197200
attribute.String("achgateway.shardKey", shardKey),
198201
attribute.String("achgateway.fileID", fileID),
@@ -231,9 +234,6 @@ func (c *FilesController) CancelFileHandler(w http.ResponseWriter, r *http.Reque
231234
}
232235

233236
func (c *FilesController) cancelFile(ctx context.Context, shardKey, fileID string, waiter chan models.FileCancellationResponse) error {
234-
// Remove .ach suffix if the request added it
235-
fileID = strings.TrimSuffix(fileID, ".ach")
236-
237237
c.cancellationLock.Lock()
238238
c.activeCancellations[fileID] = waiter
239239
c.cancellationLock.Unlock()

0 commit comments

Comments
 (0)