Merge pull request #2634 from owncloud/public-token-query-string

feat(public-token): get public-token from query string
This commit is contained in:
Florian Schade
2021-10-18 18:40:55 +02:00
committed by GitHub
+5 -1
View File
@@ -20,8 +20,12 @@ func PublicShareAuth(opts ...Option) func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Currently we only want to authenticate app open request coming from public shares.
shareToken := r.Header.Get(headerShareToken)
if shareToken == "" {
shareToken = r.URL.Query().Get(headerShareToken)
}
// Currently we only want to authenticate app open request coming from public shares.
if shareToken == "" {
// Don't authenticate
next.ServeHTTP(w, r)