Skip to content

Commit

Permalink
core: refactor http webclient part 6 #8529 (#7690)
Browse files Browse the repository at this point in the history
Add implicit string result conversion
  • Loading branch information
cadatoiva authored and ngosang committed Sep 21, 2020
1 parent 30965c0 commit 2d1ad62
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Jackett.Common/Utils/Clients/WebClientResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,17 @@ namespace Jackett.Common.Utils.Clients
public class WebClientStringResult : BaseWebResult
{
public string ContentString { get; set; }

public static implicit operator WebClientStringResult(WebClientByteResult br) => new WebClientStringResult()
{
ContentString = br.Encoding.GetString(br.ContentBytes),
Cookies = br.Cookies,
Encoding = br.Encoding,
Headers = br.Headers,
RedirectingTo = br.RedirectingTo,
Request = br.Request,
Status = br.Status
};

}
}

0 comments on commit 2d1ad62

Please sign in to comment.