Skip to content

Commit

Permalink
[PECO-1179] Added handling for staging remove (#174)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nithinkdb authored Oct 16, 2023
2 parents a9448d6 + c222a4f commit f8713a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func (c *conn) handleStagingGet(ctx context.Context, presignedUrl string, header
return nil
}

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

0 comments on commit f8713a0

Please sign in to comment.