Currently, https://hashru.link/PVwZ, which is a file uploaded with -F'file=@filename.ext', redirects to https://hashru.link/uploads/ef9841a5d7fb4917ab7dea052329e5f4/dancing-baby.gif, which serves the file.
Alternatively, we could serve the file directly, keeping https://hashru.link/PVwZ in the address bar of the user's browser.
Currently, `https://hashru.link/PVwZ`, which is a file uploaded with `-F'file=@filename.ext'`, redirects to `https://hashru.link/uploads/ef9841a5d7fb4917ab7dea052329e5f4/dancing-baby.gif`, which serves the file.
Alternatively, we could serve the file directly, keeping `https://hashru.link/PVwZ` in the address bar of the user's browser.
The reason I chose for this design is to allow the administrator to easily delegate the serving of the files to the webserver, instead of the Go process. However, to do this properly, we really want to separate the paths, s.t. you can tell the webserver to handle/cache the files immediately.
The reason I chose for this design is to allow the administrator to easily delegate the serving of the files to the webserver, instead of the Go process. However, to do this properly, we really want to separate the paths, s.t. you can tell the webserver to handle/cache the files immediately.
For future reference, this is the way to implement this in nginx (the `X-Accel-Redirect` header): https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Currently,
https://hashru.link/PVwZ, which is a file uploaded with-F'file=@filename.ext', redirects tohttps://hashru.link/uploads/ef9841a5d7fb4917ab7dea052329e5f4/dancing-baby.gif, which serves the file.Alternatively, we could serve the file directly, keeping
https://hashru.link/PVwZin the address bar of the user's browser.The reason I chose for this design is to allow the administrator to easily delegate the serving of the files to the webserver, instead of the Go process. However, to do this properly, we really want to separate the paths, s.t. you can tell the webserver to handle/cache the files immediately.
Closing as "question answered". Feel free to reopen if something is still unclear.
For future reference, this is the way to implement this in nginx (the
X-Accel-Redirectheader): https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/I decided that we should implement this, mainly because CURL does not follow redirects by default.