Skip to content

Commit

Permalink
Use https:// to avoid a redirect, set timeout as 10 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jul 4, 2017
1 parent 8df09d1 commit 3cd6d70
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fCraft/Player/Chat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public static class Chat
MatchCollection urlMatches = RegexURLMatcher.Matches(rawMessage);
foreach (Match match in urlMatches) {
if (fullUrls.Count() < 5) {
var request = (HttpWebRequest)WebRequest.Create("http://123dmwm.tk/unshorten.php?url=" + match.ToString());
Uri uri = new Uri("https://123dmwm.tk/unshorten.php?url=" + match.ToString());
HttpWebRequest request = HttpUtil.CreateRequest(uri, TimeSpan.FromSeconds(10));

string fullUrl = null;
using (var response = (HttpWebResponse)request.GetResponse()) {
var encoding = Encoding.GetEncoding(response.CharacterSet);
Expand Down

0 comments on commit 3cd6d70

Please sign in to comment.