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
a6c10185
Commit
a6c10185
authored
Oct 20, 2015
by
Jim Beveridge
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1693 from jimbeveridge/close
Close the UrlLoaderProxy on error.
parents
37b48007
2cb9a00f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
fetch.dart
packages/flutter/lib/src/services/fetch.dart
+5
-4
No files found.
packages/flutter/lib/src/services/fetch.dart
View file @
a6c10185
...
...
@@ -36,24 +36,25 @@ class Response {
}
Future
<
UrlResponse
>
fetch
(
UrlRequest
request
)
async
{
UrlLoaderProxy
loader
=
new
UrlLoaderProxy
.
unbound
();
try
{
UrlLoaderProxy
loader
=
new
UrlLoaderProxy
.
unbound
();
_networkService
.
ptr
.
createUrlLoader
(
loader
);
UrlResponse
response
=
(
await
loader
.
ptr
.
start
(
request
)).
response
;
loader
.
close
();
return
response
;
}
catch
(
e
)
{
print
(
"NetworkService unavailable
$e
"
);
return
new
UrlResponse
()..
statusCode
=
500
;
}
finally
{
loader
.
close
();
}
}
Future
<
UrlResponse
>
fetchUrl
(
String
relativeUrl
)
async
{
Future
<
UrlResponse
>
fetchUrl
(
String
relativeUrl
)
{
String
url
=
Uri
.
base
.
resolve
(
relativeUrl
).
toString
();
UrlRequest
request
=
new
UrlRequest
()
..
url
=
url
..
autoFollowRedirects
=
true
;
return
await
fetch
(
request
);
return
fetch
(
request
);
}
Future
<
Response
>
fetchBody
(
String
relativeUrl
)
async
{
...
...
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