Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-03 18:18:24 +0300
committerGitHub <noreply@github.com>2018-01-03 18:18:24 +0300
commit876238ce8ba2a9b3c65e53f88806db8e665d6248 (patch)
tree22fe1537b93fabb7ea1f2d556a56047a2e6c6eb5 /build
parentee0653d68b117ac586841465840e629a7c1a487f (diff)
parentec8bf5335618b0b60737ff9a8945d2a835933259 (diff)
Merge pull request #7533 from nextcloud/oc-28545-handle-oc-total-length-in-new-chunking
[oc] Handle OC-Total-Length in new chunking
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/WebDav.php17
-rw-r--r--build/integration/features/webdav-related.feature20
2 files changed, 37 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index 5d6ca0633b6..1354c0b1978 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -595,6 +595,23 @@ trait WebDav {
], null, "uploads");
}
+ /**
+ * @Then user :user moves new chunk file with id :id to :dest with size :size
+ */
+ public function userMovesNewChunkFileWithIdToMychunkedfileWithSize($user, $id, $dest, $size)
+ {
+ $source = '/uploads/' . $user . '/' . $id . '/.file';
+ $destination = substr($this->baseUrl, 0, -4) . $this->getDavFilesPath($user) . $dest;
+
+ try {
+ $this->response = $this->makeDavRequest($user, 'MOVE', $source, [
+ 'Destination' => $destination,
+ 'OC-Total-Length' => $size
+ ], null, "uploads");
+ } catch(\GuzzleHttp\Exception\BadResponseException $ex) {
+ $this->response = $ex->getResponse();
+ }
+ }
/**
* @Given /^Downloading file "([^"]*)" as "([^"]*)"$/
diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature
index b8ed1c4a778..77fe811fada 100644
--- a/build/integration/features/webdav-related.feature
+++ b/build/integration/features/webdav-related.feature
@@ -578,3 +578,23 @@ Feature: webdav-related
And user "user0" created a folder "/testshare"
When User "user0" moves folder "/testshare" to "/hola%5Chola"
Then the HTTP status code should be "400"
+
+ Scenario: Upload file via new chunking endpoint with wrong size header
+ Given using new dav path
+ And user "user0" exists
+ And user "user0" creates a new chunking upload with id "chunking-42"
+ And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
+ And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
+ And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
+ When user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt" with size 5
+ Then the HTTP status code should be "400"
+
+ Scenario: Upload file via new chunking endpoint with correct size header
+ Given using new dav path
+ And user "user0" exists
+ And user "user0" creates a new chunking upload with id "chunking-42"
+ And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
+ And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
+ And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
+ When user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt" with size 15
+ Then the HTTP status code should be "201"