Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
0b489692
Commit
0b489692
authored
Jan 20, 2015
by
sadgnome
Committed by
Qiang Xue
Jan 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed content-length in sendContentAsFile()
Fixed wrong Content-Length header when sending file using Response::sendContentAsFile().
parent
bdee46d1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Response.php
framework/web/Response.php
+3
-3
No files found.
framework/web/Response.php
View file @
0b489692
...
@@ -475,9 +475,6 @@ class Response extends \yii\base\Response
...
@@ -475,9 +475,6 @@ class Response extends \yii\base\Response
throw
new
HttpException
(
416
,
'Requested range not satisfiable'
);
throw
new
HttpException
(
416
,
'Requested range not satisfiable'
);
}
}
$mimeType
=
isset
(
$options
[
'mimeType'
])
?
$options
[
'mimeType'
]
:
'application/octet-stream'
;
$this
->
setDownloadHeaders
(
$attachmentName
,
$mimeType
,
!
empty
(
$options
[
'inline'
]),
$contentLength
);
list
(
$begin
,
$end
)
=
$range
;
list
(
$begin
,
$end
)
=
$range
;
if
(
$begin
!=
0
||
$end
!=
$contentLength
-
1
)
{
if
(
$begin
!=
0
||
$end
!=
$contentLength
-
1
)
{
$this
->
setStatusCode
(
206
);
$this
->
setStatusCode
(
206
);
...
@@ -488,6 +485,9 @@ class Response extends \yii\base\Response
...
@@ -488,6 +485,9 @@ class Response extends \yii\base\Response
$this
->
content
=
$content
;
$this
->
content
=
$content
;
}
}
$mimeType
=
isset
(
$options
[
'mimeType'
])
?
$options
[
'mimeType'
]
:
'application/octet-stream'
;
$this
->
setDownloadHeaders
(
$attachmentName
,
$mimeType
,
!
empty
(
$options
[
'inline'
]),
$end
-
$begin
+
1
);
$this
->
format
=
self
::
FORMAT_RAW
;
$this
->
format
=
self
::
FORMAT_RAW
;
return
$this
;
return
$this
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment