* Uppercase argument for GetHTTPStatusText

This commit is contained in:
Michaël Van Canneyt 2021-09-04 13:12:17 +02:00
parent 66a1486f32
commit a390a27420

View File

@ -133,7 +133,7 @@ Function HTTPDecode(const AStr: String): String;
Function HTTPEncode(const AStr: String): String;
Function IncludeHTTPPathDelimiter(const AStr: String): String;
Function ExcludeHTTPPathDelimiter(const AStr: String): String;
Function GetHTTPStatusText (ACode: Integer) : String;
Function GetHTTPStatusText (ACode: Cardinal; aUppercase : Boolean = False) : String;
implementation
@ -269,7 +269,7 @@ begin
Result:=AStr;
end;
Function GetHTTPStatusText (ACode: Integer) : String;
Function GetHTTPStatusText (ACode: Cardinal; aUppercase : Boolean = False) : String;
begin
Case ACode of
@ -326,8 +326,10 @@ begin
504 : Result:='Gateway Time-out';
505 : Result:='HTTP Version not supported';
else
Result:='Unknown status';
Result:=Format('Unknown status: %d',[aCode]);
end;
If aUpperCase then
Result:=Uppercase(Result);
end;
end.