You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($lengthHeader && $this->request->getMethod() === 'PUT') {
257
-
$expected = (int)$lengthHeader;
258
-
if ($count !== $expected) {
259
-
thrownewBadRequest(
260
-
$this->l10n->t(
261
-
'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.',
262
-
[
263
-
$this->l10n->n('%n byte', '%n bytes', $expected),
264
-
$this->l10n->n('%n byte', '%n bytes', $count),
265
-
],
266
-
)
267
-
);
268
-
}
251
+
if ($expected >= 0
252
+
&& $expected !== $count
253
+
&& $this->request->getMethod() === 'PUT'
254
+
) {
255
+
thrownewBadRequest(
256
+
$this->l10n->t(
257
+
'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.',
Copy file name to clipboardExpand all lines: build/integration/dav_features/dav-v2.feature
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,24 @@ Feature: dav-v2
108
108
When User "user0" uploads file "data/textfile.txt" to "/testquota/asdf.txt"
109
109
Then the HTTP status code should be "201"
110
110
111
+
Scenario: Uploading a file with very long filename
112
+
Given using new dav path
113
+
And As an "admin"
114
+
And user "user0" exists
115
+
And user "user0" has a quota of "10 MB"
116
+
And As an "user0"
117
+
When User "user0" uploads file "data/textfile.txt" to "/long-filename-with-250-characters-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.txt"
118
+
Then the HTTP status code should be "201"
119
+
120
+
Scenario: Uploading a file with a too long filename
121
+
Given using new dav path
122
+
And As an "admin"
123
+
And user "user0" exists
124
+
And user "user0" has a quota of "10 MB"
125
+
And As an "user0"
126
+
When User "user0" uploads file "data/textfile.txt" to "/long-filename-with-251-characters-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.txt"
127
+
Then the HTTP status code should be "400"
128
+
111
129
Scenario: Create a search query on image
112
130
Given using new dav path
113
131
And As an "admin"
@@ -132,3 +150,14 @@ Feature: dav-v2
132
150
Then Favorite search should work
133
151
And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
134
152
153
+
Scenario: Create a search query on favorite
154
+
Given using new dav path
155
+
And As an "admin"
156
+
And user "user0" exists
157
+
And As an "user0"
158
+
When User "user0" uploads file "data/green-square-256.png" to "/fav_image.png"
159
+
Then Favorite search should work
160
+
And the response should be empty
161
+
When user "user0" favorites element "/fav_image.png"
162
+
Then Favorite search should work
163
+
And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
0 commit comments