Our storage endpoint isn't reachable from the browser: prod does same-origin PUTs through an /api/s3-proxy route, and local dev signs against a docker-internal MinIO hostname. With the old hand-rolled route we just rewrote the presigned URL before returning it to the client.
createUpupHandler / createUpupNextHandler have no hook on the response side — hooks is only onBeforeUpload / onFileUploaded / onUploadComplete — so there's no way to rewrite uploadUrl / publicUrl before they leave the server. That makes the shipped handlers unusable for any deployment where the bucket isn't directly browser-reachable (private MinIO behind a proxy, VPC-only endpoints, etc.).
Related smaller thing: onBeforeUpload returning false becomes a generic rejection, so a pre-presign quota check ("storage limit exceeded, upgrade to keep uploading") loses its message on the way to the client. Letting the hook throw an UpupError that gets serialized into the error response would cover that.
Suggestion: an onPresignResponse(response, ctx)-style hook that can return a modified PresignedUrlResponse. That one hook would have let us adopt the built-in handler instead of keeping a custom route.
Our storage endpoint isn't reachable from the browser: prod does same-origin PUTs through an
/api/s3-proxyroute, and local dev signs against a docker-internal MinIO hostname. With the old hand-rolled route we just rewrote the presigned URL before returning it to the client.createUpupHandler/createUpupNextHandlerhave no hook on the response side —hooksis onlyonBeforeUpload/onFileUploaded/onUploadComplete— so there's no way to rewriteuploadUrl/publicUrlbefore they leave the server. That makes the shipped handlers unusable for any deployment where the bucket isn't directly browser-reachable (private MinIO behind a proxy, VPC-only endpoints, etc.).Related smaller thing:
onBeforeUploadreturningfalsebecomes a generic rejection, so a pre-presign quota check ("storage limit exceeded, upgrade to keep uploading") loses its message on the way to the client. Letting the hook throw anUpupErrorthat gets serialized into the error response would cover that.Suggestion: an
onPresignResponse(response, ctx)-style hook that can return a modifiedPresignedUrlResponse. That one hook would have let us adopt the built-in handler instead of keeping a custom route.