Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 5dda58d

Browse files
committed
Replace HttpRequestConfig helpers with methods
1 parent 03399cf commit 5dda58d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/ServiceStack.Text/HttpRequestConfig.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,10 @@ public class HttpRequestConfig
1515
public LongRange? Range { get; set; }
1616
public List<NameValue> Headers { get; set; } = new();
1717

18-
public string AuthBearer
19-
{
20-
set => Authorization = new("Bearer", value);
21-
}
22-
23-
public NameValue AuthBasic
24-
{
25-
set => Authorization = new("Basic",
26-
Convert.ToBase64String(Encoding.UTF8.GetBytes(value.Name + ":" + value.Value)));
27-
}
18+
public void SetAuthBearer(string value) => Authorization = new("Bearer", value);
19+
public void SetAuthBasic(string name, string value) =>
20+
Authorization = new("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes(name + ":" + value)));
21+
public void SetRange(long from, long? to = null) => Range = new(from, to);
2822
}
2923

3024
public record NameValue

0 commit comments

Comments
 (0)