Skip to content

Commit f8713a0

Browse files
authored
[PECO-1179] Added handling for staging remove (#174)
Earlier when I had coded this, I accidentally introduced a bug where the user facing API was delete instead of remove. This was because under the hood we are doing a delete operation. This should fix the bug, we should definitely hotfix our release. I've tested it locally for each operation this time.
2 parents a9448d6 + c222a4f commit f8713a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

connection.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ func (c *conn) handleStagingGet(ctx context.Context, presignedUrl string, header
493493
return nil
494494
}
495495

496-
func (c *conn) handleStagingDelete(ctx context.Context, presignedUrl string, headers map[string]string) dbsqlerr.DBError {
496+
func (c *conn) handleStagingRemove(ctx context.Context, presignedUrl string, headers map[string]string) dbsqlerr.DBError {
497497
client := &http.Client{}
498498
req, _ := http.NewRequest("DELETE", presignedUrl, nil)
499499
for k, v := range headers {
@@ -613,8 +613,8 @@ func (c *conn) execStagingOperation(
613613
} else {
614614
return dbsqlerrint.NewDriverError(ctx, "local file operations are restricted to paths within the configured stagingAllowedLocalPath", nil)
615615
}
616-
case "DELETE":
617-
return c.handleStagingDelete(ctx, presignedUrl, headers)
616+
case "REMOVE":
617+
return c.handleStagingRemove(ctx, presignedUrl, headers)
618618
default:
619619
return dbsqlerrint.NewDriverError(ctx, fmt.Sprintf("operation %s is not supported. Supported operations are GET, PUT, and REMOVE", operation), nil)
620620
}

0 commit comments

Comments
 (0)