mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-27 10:34:42 -05:00
feat(graph): serve public link drives to anonymous visitors
This commit is contained in:
1 parent
92c8821880
commit
baddc6b745
6 files changed
+186
-9
No files matched your search
@@ -76,6 +76,10 @@ const (
|
||||
PreconditionFailed
|
||||
// ItemIsLocked The item is locked by another process. Try again later.
|
||||
ItemIsLocked
|
||||
// PublicLinkPasswordRequired the public link is password protected and no password was provided.
|
||||
PublicLinkPasswordRequired
|
||||
// PublicLinkPasswordInvalid a password was provided for the public link but it was rejected.
|
||||
PublicLinkPasswordInvalid
|
||||
)
|
||||
|
||||
var errorCodes = [...]string{
|
||||
@@ -99,6 +103,8 @@ var errorCodes = [...]string{
|
||||
"unauthenticated",
|
||||
"preconditionFailed",
|
||||
"itemIsLocked",
|
||||
"publicLinkPasswordRequired",
|
||||
"publicLinkPasswordInvalid",
|
||||
}
|
||||
|
||||
// New constructs a new errorcode.Error
|
||||
@@ -151,6 +157,8 @@ func (e Error) Render(w http.ResponseWriter, r *http.Request) {
|
||||
status = http.StatusMethodNotAllowed
|
||||
case ItemIsLocked:
|
||||
status = http.StatusLocked
|
||||
case PublicLinkPasswordRequired, PublicLinkPasswordInvalid:
|
||||
status = http.StatusUnauthorized
|
||||
case PreconditionFailed:
|
||||
status = http.StatusPreconditionFailed
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user