Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
637cff68
Commit
637cff68
authored
10 years ago
by
Vincent Petry
Browse files
Options
Downloads
Plain Diff
Merge pull request #10862 from chli1/master
fix BadRequest error if CONTENT_LENGTH not set
parents
9fc45016
712487c8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/connector/sabre/file.php
+8
-5
8 additions, 5 deletions
lib/private/connector/sabre/file.php
with
8 additions
and
5 deletions
lib/private/connector/sabre/file.php
+
8
−
5
View file @
637cff68
...
...
@@ -102,13 +102,16 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
throw
new
OC_Connector_Sabre_Exception_FileLocked
(
$e
->
getMessage
(),
$e
->
getCode
(),
$e
);
}
// if content length is sent by client:
// double check if the file was fully received
// compare expected and actual size
$expected
=
$_SERVER
[
'CONTENT_LENGTH'
];
$actual
=
$this
->
fileView
->
filesize
(
$partFilePath
);
if
(
$actual
!=
$expected
)
{
$this
->
fileView
->
unlink
(
$partFilePath
);
throw
new
\Sabre\DAV\Exception\BadRequest
(
'expected filesize '
.
$expected
.
' got '
.
$actual
);
if
(
isset
(
$_SERVER
[
'CONTENT_LENGTH'
]))
{
$expected
=
$_SERVER
[
'CONTENT_LENGTH'
];
$actual
=
$this
->
fileView
->
filesize
(
$partFilePath
);
if
(
$actual
!=
$expected
)
{
$this
->
fileView
->
unlink
(
$partFilePath
);
throw
new
\Sabre\DAV\Exception\BadRequest
(
'expected filesize '
.
$expected
.
' got '
.
$actual
);
}
}
// rename to correct path
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment