Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
225
Merge Requests
225
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
18aaf112
Commit
18aaf112
authored
Feb 23, 2006
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#50912
by eberts: HTTP request overrides headers and data on redirect.
parent
9e7ecfa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
includes/common.inc
includes/common.inc
+7
-7
No files found.
includes/common.inc
View file @
18aaf112
...
...
@@ -366,20 +366,20 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
// Fetch response.
$response
=
''
;
while
(
!
feof
(
$fp
)
&&
$
data
=
fread
(
$fp
,
1024
))
{
$response
.
=
$
data
;
while
(
!
feof
(
$fp
)
&&
$
chunk
=
fread
(
$fp
,
1024
))
{
$response
.
=
$
chunk
;
}
fclose
(
$fp
);
// Parse response.
list
(
$
headers
,
$result
->
data
)
=
explode
(
"
\r\n\r\n
"
,
$response
,
2
);
$
headers
=
preg_split
(
"/
\r\n
|
\n
|
\r
/"
,
$headers
);
list
(
$
split
,
$result
->
data
)
=
explode
(
"
\r\n\r\n
"
,
$response
,
2
);
$
split
=
preg_split
(
"/
\r\n
|
\n
|
\r
/"
,
$split
);
list
(
$protocol
,
$code
,
$text
)
=
explode
(
' '
,
trim
(
array_shift
(
$
headers
)),
3
);
list
(
$protocol
,
$code
,
$text
)
=
explode
(
' '
,
trim
(
array_shift
(
$
split
)),
3
);
$result
->
headers
=
array
();
// Parse headers.
while
(
$line
=
trim
(
array_shift
(
$
headers
)))
{
while
(
$line
=
trim
(
array_shift
(
$
split
)))
{
list
(
$header
,
$value
)
=
explode
(
':'
,
$line
,
2
);
if
(
isset
(
$result
->
headers
[
$header
])
&&
$header
==
'Set-Cookie'
)
{
// RFC 2109: the Set-Cookie response header comprises the token Set-
...
...
@@ -1337,4 +1337,4 @@ function page_set_cache() {
}
}
}
}
}
\ No newline at end of file
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