Skip to content

feat: add a warning in case the object doesn't exists before generating the presign url#773

Merged
imiric merged 4 commits intoexoscale:masterfrom
mlec1:check-object-before-presign
Apr 2, 2026
Merged

feat: add a warning in case the object doesn't exists before generating the presign url#773
imiric merged 4 commits intoexoscale:masterfrom
mlec1:check-object-before-presign

Conversation

@mlec1
Copy link
Copy Markdown
Contributor

@mlec1 mlec1 commented Dec 18, 2025

Description

It happened sometimes that when I want to generate a presigned url, I make a typo in the object name / path.

And it is only when I sent the link to someone or when I want to download the object, that I notice that the URL returns 404.
I would prefer to notice it when I generate the URL.

This MR adds a warning message when the object doesn't exists. For the moment, only a warning, I could return the error and no presigned url at all if you prefer.

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block)
  • Testing

Testing

@kobajagi
Copy link
Copy Markdown
Contributor

kobajagi commented Mar 3, 2026

Legit:

> go run . storage presign predrag-test-bucket/README1.md
⚠️ The object predrag-test-bucket/README1.md does not exist. The Presigned URL will return 404 ⚠️

https://sos-ch-gva-2.exo.io/predrag-test-bucket/README1.md?X-Amz-Algorithm=***....

Copy link
Copy Markdown
Member

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this seems useful. 👍 Just left a minor formatting suggestion.

It would be good to have a test for it, but it's not a blocker.

The main CI workflow didn't run for some reason (I didn't see an approval request), but make test passed locally for me.

@imiric
Copy link
Copy Markdown
Member

imiric commented Apr 2, 2026

Thanks for the changes!

@imiric imiric merged commit 2aa48ff into exoscale:master Apr 2, 2026
5 checks passed
@mlec1 mlec1 deleted the check-object-before-presign branch April 2, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants