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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
0b8d239a
Commit
0b8d239a
authored
Jun 11, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed HeaderCollection::addDefault to setDefault.
parent
d7cb4ce9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
HeaderCollection.php
framework/yii/web/HeaderCollection.php
+2
-2
Response.php
framework/yii/web/Response.php
+19
-19
No files found.
framework/yii/web/HeaderCollection.php
View file @
0b8d239a
...
@@ -104,13 +104,13 @@ class HeaderCollection extends Object implements \IteratorAggregate, \ArrayAcces
...
@@ -104,13 +104,13 @@ class HeaderCollection extends Object implements \IteratorAggregate, \ArrayAcces
}
}
/**
/**
*
Add
s a new header only if it does not exist yet.
*
Set
s a new header only if it does not exist yet.
* If there is already a header with the same name, the new one will be ignored.
* If there is already a header with the same name, the new one will be ignored.
* @param string $name the name of the header
* @param string $name the name of the header
* @param string $value the value of the header
* @param string $value the value of the header
* @return HeaderCollection the collection object itself
* @return HeaderCollection the collection object itself
*/
*/
public
function
add
Default
(
$name
,
$value
)
public
function
set
Default
(
$name
,
$value
)
{
{
$name
=
strtolower
(
$name
);
$name
=
strtolower
(
$name
);
if
(
empty
(
$this
->
_headers
[
$name
]))
{
if
(
empty
(
$this
->
_headers
[
$name
]))
{
...
...
framework/yii/web/Response.php
View file @
0b8d239a
...
@@ -309,14 +309,14 @@ class Response extends \yii\base\Response
...
@@ -309,14 +309,14 @@ class Response extends \yii\base\Response
throw
new
HttpException
(
416
,
Yii
::
t
(
'yii'
,
'Requested range not satisfiable'
));
throw
new
HttpException
(
416
,
Yii
::
t
(
'yii'
,
'Requested range not satisfiable'
));
}
}
$headers
->
add
Default
(
'Pragma'
,
'public'
)
$headers
->
set
Default
(
'Pragma'
,
'public'
)
->
add
Default
(
'Accept-Ranges'
,
'bytes'
)
->
set
Default
(
'Accept-Ranges'
,
'bytes'
)
->
add
Default
(
'Expires'
,
'0'
)
->
set
Default
(
'Expires'
,
'0'
)
->
add
Default
(
'Content-Type'
,
$mimeType
)
->
set
Default
(
'Content-Type'
,
$mimeType
)
->
add
Default
(
'Cache-Control'
,
'must-revalidate, post-check=0, pre-check=0'
)
->
set
Default
(
'Cache-Control'
,
'must-revalidate, post-check=0, pre-check=0'
)
->
add
Default
(
'Content-Transfer-Encoding'
,
'binary'
)
->
set
Default
(
'Content-Transfer-Encoding'
,
'binary'
)
->
add
Default
(
'Content-Length'
,
StringHelper
::
strlen
(
$content
))
->
set
Default
(
'Content-Length'
,
StringHelper
::
strlen
(
$content
))
->
add
Default
(
'Content-Disposition'
,
"attachment; filename=
\"
$attachmentName
\"
"
);
->
set
Default
(
'Content-Disposition'
,
"attachment; filename=
\"
$attachmentName
\"
"
);
list
(
$begin
,
$end
)
=
$range
;
list
(
$begin
,
$end
)
=
$range
;
if
(
$begin
!=
0
||
$end
!=
$contentLength
-
1
)
{
if
(
$begin
!=
0
||
$end
!=
$contentLength
-
1
)
{
...
@@ -360,14 +360,14 @@ class Response extends \yii\base\Response
...
@@ -360,14 +360,14 @@ class Response extends \yii\base\Response
$length
=
$end
-
$begin
+
1
;
$length
=
$end
-
$begin
+
1
;
$headers
->
add
Default
(
'Pragma'
,
'public'
)
$headers
->
set
Default
(
'Pragma'
,
'public'
)
->
add
Default
(
'Accept-Ranges'
,
'bytes'
)
->
set
Default
(
'Accept-Ranges'
,
'bytes'
)
->
add
Default
(
'Expires'
,
'0'
)
->
set
Default
(
'Expires'
,
'0'
)
->
add
Default
(
'Content-Type'
,
$mimeType
)
->
set
Default
(
'Content-Type'
,
$mimeType
)
->
add
Default
(
'Cache-Control'
,
'must-revalidate, post-check=0, pre-check=0'
)
->
set
Default
(
'Cache-Control'
,
'must-revalidate, post-check=0, pre-check=0'
)
->
add
Default
(
'Content-Transfer-Encoding'
,
'binary'
)
->
set
Default
(
'Content-Transfer-Encoding'
,
'binary'
)
->
add
Default
(
'Content-Length'
,
$length
)
->
set
Default
(
'Content-Length'
,
$length
)
->
add
Default
(
'Content-Disposition'
,
"attachment; filename=
\"
$attachmentName
\"
"
);
->
set
Default
(
'Content-Disposition'
,
"attachment; filename=
\"
$attachmentName
\"
"
);
$this
->
send
();
$this
->
send
();
...
@@ -478,9 +478,9 @@ class Response extends \yii\base\Response
...
@@ -478,9 +478,9 @@ class Response extends \yii\base\Response
}
}
$this
->
getHeaders
()
$this
->
getHeaders
()
->
add
Default
(
$xHeader
,
$filePath
)
->
set
Default
(
$xHeader
,
$filePath
)
->
add
Default
(
'Content-Type'
,
$mimeType
)
->
set
Default
(
'Content-Type'
,
$mimeType
)
->
add
Default
(
'Content-Disposition'
,
"attachment; filename=
\"
$attachmentName
\"
"
);
->
set
Default
(
'Content-Disposition'
,
"attachment; filename=
\"
$attachmentName
\"
"
);
$this
->
send
();
$this
->
send
();
}
}
...
...
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