Skip to content

Commit

Permalink
fallabck filename for curl stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
watzon committed Jan 13, 2025
1 parent 6d8697b commit 39d9112
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/server/services/paste.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ func (s *PasteService) UploadPaste(c *fiber.Ctx) error {
// First check for a filename in form field
if formFilename := c.FormValue("filename"); formFilename != "" {
filename = formFilename
} else if file.Filename != "" { // Fall back to uploaded file's filename
} else if file.Filename != "" && file.Filename != "-" { // Don't use "-" as filename
filename = file.Filename
} else {
filename = "paste.txt" // Default filename
}
} else if p.URL != "" {
// Read content from the given URL
Expand Down

0 comments on commit 39d9112

Please sign in to comment.