-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent panic on /remote.php/dav/files/ #1320
Merged
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
23783b1
avoid panic on /remote.php/dav/files/
refs 370830e
Merge branch 'master' into dav-files-unimplemented
refs 24bf5c4
contain changes only to ocdav.go
refs b8222bd
enhance xml error response
refs f02d7ab
fix linter
refs b6a59b9
adjust expected scenario
refs f972f66
add changelog
refs 5c0cef9
error check write operation
refs 3cf4e25
Merge branch 'master' into dav-files-unimplemented
refs 392ea67
undo [tests-only]
refs c777d6f
move block from propfind -> dav
refs 251c49f
remove expected to fail scenario
refs 0f5f818
delete apiShareWebdavOperations-propfind.feature
refs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,5 @@ | ||
Bugfix: Do not panic on remote.php/dav/files/ | ||
|
||
Currently requests to /remote.php/dav/files/ result in panics since we cannot longer strip the user + destination from the url. This fixes the server response code and adds an error body to the response. | ||
|
||
https://github.com/cs3org/reva/pull/1320 |
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,51 @@ | ||
// Copyright 2018-2020 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 ocdav | ||
|
||
import ( | ||
"encoding/xml" | ||
) | ||
|
||
type code int | ||
|
||
const ( | ||
// SabredavMethodNotAllowed maps to HTTP 405 | ||
SabredavMethodNotAllowed code = iota | ||
) | ||
|
||
var ( | ||
codesEnum = []string{ | ||
"Sabre\\DAV\\Exception\\MethodNotAllowed", | ||
} | ||
) | ||
|
||
type exception struct { | ||
code code | ||
message string | ||
} | ||
|
||
// Marshal just calls the xml marshaller for a given exception. | ||
func Marshal(e exception) ([]byte, error) { | ||
return xml.Marshal(&errorXML{ | ||
Xmlnsd: "DAV", | ||
Xmlnss: "http://sabredav.org/ns", | ||
Exception: codesEnum[e.code], | ||
Message: e.message, | ||
}) | ||
} |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you check the line above you should find the
after fixing all issues delete this Scenario and use the one from oC10 core
, meaning that AFAICT this complete feature file can be removed, as it is covered by the core tests.tests/acceptance/features/apiOcisSpecific/apiShareWebdavOperations-propfind.feature