Skip to content

Commit 274b4b3

Browse files
committed
Cleanup
1 parent 5c339a7 commit 274b4b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

RestSharp/RestRequest.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,8 @@ public IRestRequest AddOrUpdateParameter(string name, object value, string conte
555555
/// <returns></returns>
556556
public IRestRequest AddHeader(string name, string value)
557557
{
558-
bool InvalidHost(string host)
559-
{
560-
return Uri.CheckHostName(PortSplitRegex.Split(host)[0]) == UriHostNameType.Unknown;
561-
}
558+
bool InvalidHost(string host) =>
559+
Uri.CheckHostName(PortSplitRegex.Split(host)[0]) == UriHostNameType.Unknown;
562560

563561
if (name == "Host" && InvalidHost(value))
564562
throw new ArgumentException("The specified value is not a valid Host header string.", nameof(value));

0 commit comments

Comments
 (0)