* BlogsController.cs: fixes the bug rendering the avatar
* GoogleController.cs: fixes the bug at reusing the same url in a (Http)WebRequest (call Abort() when finiched)
This commit is contained in:
parent
753e5290bb
commit
29046a3e07
2 changed files with 58 additions and 12 deletions
|
|
@ -246,9 +246,16 @@ namespace Yavsc.Controllers
|
|||
return File (fia.OpenRead (), defaultAvatarMimetype);
|
||||
}
|
||||
WebRequest wr = WebRequest.Create(avpath);
|
||||
WebResponse resp = wr.GetResponse ();
|
||||
Stream str = resp.GetResponseStream ();
|
||||
return File (str, resp.ContentType);
|
||||
FileContentResult res;
|
||||
using (WebResponse resp = wr.GetResponse ()) {
|
||||
using (Stream str = resp.GetResponseStream ()) {
|
||||
byte [] content = new byte[str.Length];
|
||||
str.Read (content, 0, (int) str.Length);
|
||||
res = File (content, resp.ContentType);
|
||||
wr.Abort ();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue