mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
make HTTP shares browsable
if you share a single folder with read scope, you can now browse the share and download single files Fixes #674 See #677 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -1007,6 +1007,8 @@ func (s *httpdServer) initializeRouter() {
|
||||
s.router.Get(sharesPath+"/{id}", downloadFromShare)
|
||||
s.router.Post(sharesPath+"/{id}", uploadFilesToShare)
|
||||
s.router.Post(sharesPath+"/{id}/{name}", uploadFileToShare)
|
||||
s.router.Get(sharesPath+"/{id}/dirs", readBrowsableShareContents)
|
||||
s.router.Get(sharesPath+"/{id}/files", downloadBrowsableSharedFile)
|
||||
|
||||
s.router.Get(tokenPath, s.getToken)
|
||||
s.router.Post(adminPath+"/{username}/forgot-password", forgotAdminPassword)
|
||||
@@ -1226,6 +1228,8 @@ func (s *httpdServer) initializeRouter() {
|
||||
Post(webClientTwoFactorRecoveryPath, s.handleWebClientTwoFactorRecoveryPost)
|
||||
// share API exposed to external users
|
||||
s.router.Get(webClientPubSharesPath+"/{id}", downloadFromShare)
|
||||
s.router.Get(webClientPubSharesPath+"/{id}/browse", s.handleShareGetFiles)
|
||||
s.router.Get(webClientPubSharesPath+"/{id}/dirs", s.handleShareGetDirContents)
|
||||
s.router.Post(webClientPubSharesPath+"/{id}", uploadFilesToShare)
|
||||
s.router.Post(webClientPubSharesPath+"/{id}/{name}", uploadFileToShare)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user