somenonymous / OshiUpload

Ephemeral file sharing engine
Do What The F*ck You Want To Public License
164 stars 23 forks source link

Return URL with SSL by default. #20

Open 8dcc opened 1 year ago

8dcc commented 1 year ago

If you upload a file using:

$ curl -T file.txt oshi.at

http://oshi.at/a/... [Admin]
http://oshi.at/... [Download]
http://5ety7tpkim5me6eszuwcje7bmy25pbtrjtue7zkqqgziljwqy3rrikqd.onion/... [Tor download]

The response is always the http:// address. I am guessing this is because curl is translating oshi.at to http://oshi.at, since doing:

$ curl -T file.txt https://oshi.at

https://oshi.at/a/... [Admin]
https://oshi.at/... [Download]
http://5ety7tpkim5me6eszuwcje7bmy25pbtrjtue7zkqqgziljwqy3rrikqd.onion/... [Tor download]

Returns the https:// address.

The issue is that doing:

$ curl http://oshi.at/...
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Always returns this HTML response because it expects the https:// address. I am not sure if this is intentional but I wanted to point it out since you could just always return the https:// URL, even when uploading to http://oshi.at.