-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix propfind listing for files (#2506)
Showing
7 changed files
with
139 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Bugfix: Fix propfind listing for files | ||
|
||
When doing a propfind for a file the result contained the files twice. | ||
|
||
https://github.com/owncloud/ocis/issues/3066 | ||
https://github.com/cs3org/reva/pull/2506 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2018-2022 CERN | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// In applying this license, CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
package net | ||
|
||
import "testing" | ||
|
||
func TestParseDepth(t *testing.T) { | ||
tests := map[string]Depth{ | ||
"": DepthOne, | ||
"0": DepthZero, | ||
"1": DepthOne, | ||
"infinity": DepthInfinity, | ||
} | ||
|
||
for input, expected := range tests { | ||
parsed, err := ParseDepth(input) | ||
if err != nil { | ||
t.Errorf("failed to parse depth %s", input) | ||
} | ||
if parsed != expected { | ||
t.Errorf("parseDepth returned %s expected %s", parsed.String(), expected.String()) | ||
} | ||
} | ||
|
||
_, err := ParseDepth("invalid") | ||
if err == nil { | ||
t.Error("parse depth didn't return an error for invalid depth: invalid") | ||
} | ||
} | ||
|
||
var result Depth | ||
|
||
func BenchmarkParseDepth(b *testing.B) { | ||
inputs := []string{"", "0", "1", "infinity", "INFINITY"} | ||
size := len(inputs) | ||
for i := 0; i < b.N; i++ { | ||
result, _ = ParseDepth(inputs[i%size]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters