Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Yeray Santana Hualde
syncEnrollments
Commits
ea820add
Commit
ea820add
authored
Mar 12, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make headers case-insensitive.
Signed-off-by:
Taylor Otwell
<
taylorotwell@gmail.com
>
parent
afcb60ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
response.php
laravel/response.php
+11
-11
No files found.
laravel/response.php
View file @
ea820add
...
@@ -181,14 +181,14 @@ class Response {
...
@@ -181,14 +181,14 @@ class Response {
if
(
is_null
(
$name
))
$name
=
basename
(
$path
);
if
(
is_null
(
$name
))
$name
=
basename
(
$path
);
$headers
=
array_merge
(
array
(
$headers
=
array_merge
(
array
(
'
Content-D
escription'
=>
'File Transfer'
,
'
content-d
escription'
=>
'File Transfer'
,
'
Content-T
ype'
=>
File
::
mime
(
File
::
extension
(
$path
)),
'
content-t
ype'
=>
File
::
mime
(
File
::
extension
(
$path
)),
'
Content-D
isposition'
=>
'attachment; filename="'
.
$name
.
'"'
,
'
content-d
isposition'
=>
'attachment; filename="'
.
$name
.
'"'
,
'
Content-Transfer-E
ncoding'
=>
'binary'
,
'
content-transfer-e
ncoding'
=>
'binary'
,
'
E
xpires'
=>
0
,
'
e
xpires'
=>
0
,
'
Cache-C
ontrol'
=>
'must-revalidate, post-check=0, pre-check=0'
,
'
cache-c
ontrol'
=>
'must-revalidate, post-check=0, pre-check=0'
,
'
P
ragma'
=>
'public'
,
'
p
ragma'
=>
'public'
,
'
Content-L
ength'
=>
File
::
size
(
$path
),
'
content-l
ength'
=>
File
::
size
(
$path
),
),
$headers
);
),
$headers
);
return
new
static
(
File
::
get
(
$path
),
200
,
$headers
);
return
new
static
(
File
::
get
(
$path
),
200
,
$headers
);
...
@@ -279,11 +279,11 @@ class Response {
...
@@ -279,11 +279,11 @@ class Response {
// If the content type was not set by the developer, we will set the
// If the content type was not set by the developer, we will set the
// header to a default value that indicates to the browser that the
// header to a default value that indicates to the browser that the
// response is HTML and that it uses the default encoding.
// response is HTML and that it uses the default encoding.
if
(
!
isset
(
$this
->
headers
[
'
Content-T
ype'
]))
if
(
!
isset
(
$this
->
headers
[
'
content-t
ype'
]))
{
{
$encoding
=
Config
::
get
(
'application.encoding'
);
$encoding
=
Config
::
get
(
'application.encoding'
);
$this
->
header
(
'
Content-T
ype'
,
'text/html; charset='
.
$encoding
);
$this
->
header
(
'
content-t
ype'
,
'text/html; charset='
.
$encoding
);
}
}
// Once the framework controlled headers have been sentm, we can
// Once the framework controlled headers have been sentm, we can
...
@@ -314,7 +314,7 @@ class Response {
...
@@ -314,7 +314,7 @@ class Response {
*/
*/
public
function
header
(
$name
,
$value
)
public
function
header
(
$name
,
$value
)
{
{
$this
->
headers
[
$name
]
=
$value
;
$this
->
headers
[
strtolower
(
$name
)
]
=
$value
;
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