File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3418,8 +3418,13 @@ procedure TRESTClientPoolerBase.SetIpVersion(IpV: TRESTDWClientIpVersions);
34183418 vDataBuff := ' ' ;
34193419 vRequestHeader := TStringList.Create;
34203420 vCompareContext := False;
3421+ { TODO 1 -oRoniery -ccorreção : função para fazer decode de url utf8 para ascii }
3422+ RawHTTPCommand := DecodeURL(RawHTTPCommand);
3423+ QueryParams := DecodeURL(QueryParams);
34213424 Cmd := RemoveBackslashCommands(Trim(RawHTTPCommand));
34223425 vUrlToExec := ' ' ;
3426+
3427+
34233428 Try
34243429 sCharSet := ' ' ;
34253430 If (UpperCase(Copy (Cmd, 1 , 3 )) = ' GET' ) Then
Original file line number Diff line number Diff line change @@ -457,6 +457,8 @@ interface
457457 Const CharSet : TCharSet) : Boolean;Overload;
458458 Procedure InitializeStrings ;
459459
460+ function DecodeURL (const urlEncoded: string): string;
461+
460462Implementation
461463
462464Uses
@@ -4963,6 +4965,29 @@ function abbintohexstring(stream: Tstream):string;
49634965 { $ENDIF}
49644966End ;
49654967
4968+ function DecodeURL (const urlEncoded: string): string;
4969+ var
4970+ i: Integer;
4971+ hexValue: string;
4972+ begin
4973+ Result := ' ' ;
4974+ i := 1 ;
4975+ while i <= Length(urlEncoded) do
4976+ begin
4977+ if urlEncoded[i] = ' %' then
4978+ begin
4979+ hexValue := Copy(urlEncoded, i + 1 , 2 );
4980+ Result := Result + Char(StrToInt(' $' + hexValue));
4981+ Inc(i, 3 );
4982+ end
4983+ else
4984+ begin
4985+ Result := Result + urlEncoded[i];
4986+ Inc(i);
4987+ end ;
4988+ end ;
4989+ end ;
4990+
49664991initialization
49674992 InitializeStrings;
49684993
You can’t perform that action at this time.
0 commit comments