mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-06 07:22:17 +00:00
No error returned when Max-Days is invalid #149
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @anihm136 on GitHub.
When a file is uploaded with a very high value set for
Max-Daysheader, the server returns a URL. However, the URL leads to a 404 pageExpected behavior:
The server should return an appropriate 400 response when an invalid value is set for the header
@anihm136 commented on GitHub:
Maybe overkill, but I did a binary search and it appears to fail at 8217934 days
@paolafrancesca commented on GitHub:
Indeed it seems so @jimmybrancaccio, glad you spotted this so soon.
I've reverted the PR
@kugiyasan it should be something like this, can you create a new PR?
thanks
@jimmybrancaccio commented on GitHub:
I'm curious if this broke uploading as I am getting a 400 error now on my self-hosted install and when attempting to upload a file via the command line. On the command line I see:
I didn't provide the header and I assume it shouldn't be a requirement?
Edit:
I wonder if in
server/handlers.goit should be something like:I don't know anything about Go, but I think you may understand my point? Basically it checks to see if
metadata.MaxDatehas a value and performs thetime.Now().After(metadata.MaxDate)condition check.@paolafrancesca commented on GitHub:
@anihm136 how much high the value must be set?
@kugi83 commented on GitHub:
Hey can I take this issue?
@jimmybrancaccio commented on GitHub:
Looks good now @aspacca and @kugiyasan Thank you both! ❤️
@kugi83 commented on GitHub:
Oops sorry! I made the PR asap, @aspacca