Skip to content

Commit

Permalink
fix problem processing content on tx endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed May 1, 2024
1 parent 7f71f9f commit ab0559f
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions server/web_server.pas
Original file line number Diff line number Diff line change
Expand Up @@ -949,28 +949,21 @@ procedure TFhirWebServer.PlainRequest(AContext: TIdContext;

procedure TFhirWebServer.ProcessFile(sender: TObject; session: TFhirSession; named, path: String; secure: boolean; variables: TFslMap<TFHIRObject>; var result: String);
var
s, n: String;
s, n, h, t: String;
i : integer;
begin
s := SourceProvider.getSource(named);
s := s.Replace('[%id%]', Common.Name, [rfReplaceAll]);
s := s.Replace('[%specurl%]', 'http://hl7.org/fhir', [rfReplaceAll]);
s := s.Replace('[%web%]', WebDesc(secure), [rfReplaceAll]);
s := s.Replace('[%admin%]', Common.AdminEmail, [rfReplaceAll]);
s := s.Replace('[%logout%]', 'User: [n/a]', [rfReplaceAll]);
s := s.Replace('[%endpoints%]', endpointList, [rfReplaceAll]);
if Common.StatedPort = 80 then
s := s.Replace('[%host%]', Common.Host, [rfReplaceAll])
else
s := s.Replace('[%host%]', Common.Host + ':' + inttostr(Common.StatedPort), [rfReplaceAll]);

if Common.StatedSSLPort = 443 then
s := s.Replace('[%securehost%]', Common.Host, [rfReplaceAll])
else
s := s.Replace('[%securehost%]', Common.Host + ':' + inttostr(Common.StatedSSLPort), [rfReplaceAll]);
if variables <> nil then
for n in variables.Keys do
s := s.Replace('[%' + n + '%]', variables[n].primitiveValue, [rfReplaceAll]);
s := s.Replace('[%ver%]', 'n/a', [rfReplaceAll]);
i := s.IndexOf('[%');
while (i > -1) do
begin
h := s.subString(0, i);
s := s.subString(i);
i := s.indexOf('%]');
t := s.subString(i+2);
n := s.Substring(2, i-2);
s := h + insertValue(n, secure, variables) + t;
i := s.IndexOf('[%');
end;
result := s;
end;

Expand Down

0 comments on commit ab0559f

Please sign in to comment.