Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
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
abdullh.alsoleman
Front-End
Commits
aff752f8
Commit
aff752f8
authored
May 09, 2016
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mojo_client: Dont try to iterate over response headers if there aren't any. (#3811)
parent
8e9334fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
mojo_client.dart
packages/flutter/lib/src/http/mojo_client.dart
+6
-4
No files found.
packages/flutter/lib/src/http/mojo_client.dart
View file @
aff752f8
...
...
@@ -180,10 +180,12 @@ class MojoClient {
ByteData
data
=
await
mojo
.
DataPipeDrainer
.
drainHandle
(
response
.
body
);
Uint8List
bodyBytes
=
new
Uint8List
.
view
(
data
.
buffer
);
Map
<
String
,
String
>
headers
=
<
String
,
String
>{};
for
(
mojom
.
HttpHeader
header
in
response
.
headers
)
{
String
headerName
=
header
.
name
.
toLowerCase
();
String
existingValue
=
headers
[
headerName
];
headers
[
headerName
]
=
existingValue
!=
null
?
'
$existingValue
,
${header.value}
'
:
header
.
value
;
if
(
response
.
headers
!=
null
)
{
for
(
mojom
.
HttpHeader
header
in
response
.
headers
)
{
String
headerName
=
header
.
name
.
toLowerCase
();
String
existingValue
=
headers
[
headerName
];
headers
[
headerName
]
=
existingValue
!=
null
?
'
$existingValue
,
${header.value}
'
:
header
.
value
;
}
}
return
new
Response
.
bytes
(
bodyBytes
,
response
.
statusCode
,
headers:
headers
);
}
catch
(
exception
,
stack
)
{
...
...
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