Skip to content

Commit 5358345

Browse files
committed
don't add trailing slash if assembled is null
1 parent 109cf8e commit 5358345

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

RestSharp/RestClient.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,17 @@ public Uri BuildUri(IRestRequest request)
304304
assembled = assembled.Substring(1);
305305
}
306306

307-
if(!string.IsNullOrEmpty(BaseUrl))
308-
assembled = string.Format("{0}/{1}", BaseUrl, assembled);
307+
if (!string.IsNullOrEmpty(BaseUrl))
308+
{
309+
if (string.IsNullOrEmpty(assembled))
310+
{
311+
assembled = BaseUrl;
312+
}
313+
else
314+
{
315+
assembled = string.Format("{0}/{1}", BaseUrl, assembled);
316+
}
317+
}
309318

310319
if (request.Method != Method.POST && request.Method != Method.PUT && request.Method != Method.PATCH)
311320
{

0 commit comments

Comments
 (0)