Skip to content

Commit

Permalink
Issue #207
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez committed May 22, 2024
1 parent b0619f8 commit caa3a64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion samples/client/lazarus/src/samples.main.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object FrmMain: TFrmMain
Caption = 'FrmMain'
ClientHeight = 600
ClientWidth = 1000
LCLVersion = '2.0.10.0'
LCLVersion = '2.2.6.0'
object Panel1: TPanel
Left = 0
Height = 78
Expand Down
10 changes: 7 additions & 3 deletions src/RESTRequest4D.Request.FPHTTPClient.pas
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ function TRequestFPHTTPClient.BaseURL: string;
function TRequestFPHTTPClient.Resource(const AResource: string): IRequest;
begin
Result := Self;
FResource := AResource;
FResource := AResource.Trim;
if FResource.StartsWith('/') then
FResource := Copy(FResource, 2, Pred(Length(FResource)));
end;

function TRequestFPHTTPClient.RaiseExceptionOn500: Boolean;
Expand All @@ -277,7 +279,9 @@ function TRequestFPHTTPClient.Resource: string;
function TRequestFPHTTPClient.ResourceSuffix(const AResourceSuffix: string): IRequest;
begin
Result := Self;
FResourceSuffix := AResourceSuffix;
FResourceSuffix := AResourceSuffix.Trim;
if FResourceSuffix.StartsWith('/') then
FResourceSuffix := Copy(FResourceSuffix, 2, Pred(Length(FResourceSuffix)));
end;

function TRequestFPHTTPClient.ResourceSuffix: string;
Expand Down Expand Up @@ -537,7 +541,7 @@ function TRequestFPHTTPClient.MakeURL(const AIncludeParams: Boolean): string;
var
I: Integer;
begin
Result := FBaseURL;
Result := FBaseURL.Trim;
if not FResource.Trim.IsEmpty then
begin
if not Result.EndsWith('/') then
Expand Down

0 comments on commit caa3a64

Please sign in to comment.