Einzelnen Beitrag anzeigen

Shark99

Registriert seit: 16. Mai 2007
403 Beiträge
 
#2

AW: Kleine Indy 10 Http Client Warnung bezüglich UserAgent

  Alt 31. Jan 2013, 07:02
Und hier gleich die Lösung um die Schleife zu vermeiden und statt dessen ein (falsches) 404 bekommen (sollte ja 403 sein).

IdGlobalProtocols.pas
Delphi-Quellcode:
function ParseHTTPMetaEquiveData(const AStr : String; var VPos : Integer;
  const ALen : Integer) : String; {$IFDEF USE_INLINE}inline;{$ENDIF}
var
  LQuoteChar : Char;
  LWord : String;
begin
  Result := '';
  DiscardDocWhiteSpace(AStr, VPos, ALen);
...
  repeat
    DiscardDocWhiteSpace(AStr, VPos, ALen);
...
    if AStr[VPos] = '=then begin {do not localize}
      Inc(VPos);
      DiscardDocWhiteSpace(AStr, VPos, ALen);
      if CharIsInSet(AStr, VPos, HTML_QUOTECHARS) then begin
        LQuoteChar := AStr[VPos];
        Inc(VPos);
        if TextIsSame(LWord, 'CONTENT') then begin
          Result := Result + ' ' + ParseUntil(AStr, LQuoteChar, VPos, ALen);
        end else begin
          DiscardUntil(AStr, LQuoteChar, VPos, ALen);
        end;
        Inc(VPos);
      end else begin
        if TextIsSame(LWord, 'CONTENT') then begin
          Result := Result + ' ' + ParseUntilCharOrEndOfTag(AStr, ' ', VPos, ALen); {do not localize}
        end else begin
          DiscardUntilCharOrEndOfTag(AStr, ' ', VPos, ALen); {do not localize}
        end;
      end;
    end;
    Inc(VPos); // ********************** NEUER CODE ***********************
  until False;
end;
  Mit Zitat antworten Zitat