Repository navigation
feat: preserve file extensions in upload URLs - #92
Merged
Merged
Conversation
- Add X-Filename header to all file upload requests in CLI - Server already supports filename in URL path and metadata - Update CLI to send basename of uploaded file to server - Affects both encrypted and non-encrypted uploads - Resolves #90 When uploading files using --file flag, the original filename is now included in the returned URL, allowing proper file type identification: - Before: https://paste.d3d.dev/AbCdEfGh - After: https://paste.d3d.dev/AbCdEfGh/document.pdf 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
github-actions Bot
added a commit
that referenced
this pull request
Oct 7, 2025
Version bump type: minor PR: #92 Title: feat: preserve file extensions in upload URLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #90 - Adds proper file extension preservation for file uploads and downloads.
When uploading files using
dedpaste --file somefile.pdf, the original filename and extension are now preserved in the retrieval URL, allowing proper file type identification upon download.Changes Made
cli/index.tsto sendX-Filenameheader with the basename of uploaded filesTechnical Details
The server-side code already supported this feature:
X-Filenameheader and stores it in R2 metadata/{id}/{filename}and/e/{id}/{filename}The gap was that the CLI never sent the filename header. This PR closes that gap.
Before/After Examples
Before
After
Use Cases Addressed
Test Plan
🤖 Generated with Claude Code