THRIFT-5384 Improved error message for HTTP transports
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.Transport.pas b/lib/delphi/src/Thrift.Transport.pas
index 6a69d93..79fc977 100644
--- a/lib/delphi/src/Thrift.Transport.pas
+++ b/lib/delphi/src/Thrift.Transport.pas
@@ -1437,7 +1437,9 @@
if Int64(size) > Int64(Configuration.MaxFrameSize) then begin
Close();
- raise TTransportExceptionCorruptedData.Create('Frame size ('+IntToStr(size)+') larger than allowed maximum ('+IntToStr(Configuration.MaxFrameSize)+')');
+ if CharUtils.IsHtmlDoctype(size)
+ then raise TTransportExceptionCorruptedData.Create('Remote end sends HTML instead of data')
+ else raise TTransportExceptionCorruptedData.Create('Frame size ('+IntToStr(size)+') larger than allowed maximum ('+IntToStr(Configuration.MaxFrameSize)+')');
end;
UpdateKnownMessageSize(size + SizeOf(size));