-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Limiting Incoming Stream Size in TIdHTTPServer #486
Comments
There are two different ways you can handle this in the current version:
|
Thank you very much! I will check this and get back to you. |
Hi @rlebeau. I've checked the If I set Do I have to "send" the response in some way? Thx! |
No, the response is sent automatically after the event handlers return, as you can see in the source code:
|
You are right. I tested it with Chrome and there I get the correct return code. Thank you very much. |
The limitation with the custom Stream and OnCreatePostStream also works great! |
There is no "normal chunk size" in HTTP. If the client or server sends a chunked message, each chunk specifies its own size, so it can be whatever size the sender wants. In this case, depending on buffering, the size written to the |
Dear Indy development team,
I am using your great Indy library in Delphi for an application that receives HTTP requests through the TIdHTTPServer component. I am looking for a way to limit the size of incoming data streams, and stop receiving them when they exceed a certain size limit.
After looking through the documentation and the available events of the TIdHTTPServer component, it appears that there isn't currently a way to achieve this. The OnCommandGet event, for example, only gets triggered after the full request data stream has been received from the client. There doesn't seem to be an event that is called while the stream is still being received, which would allow me to stop the receiving process based on the size received so far.
Therefore, I would like to propose the addition of a new feature that allows users to set a maximum size for incoming data streams and abort the reception process if this size is exceeded. I believe that this would be a valuable feature that could help to prevent potential problems caused by clients sending overly large requests.
I am hopeful that you will consider this feature for future versions of the library or I would appreciate any guidance or pointers you could provide that would help us to implement this feature on our own. I also like to contribute to the Indy project and I believe that my work could benefit other users as well.
Thanks in advance and best regards,
Dennis
The text was updated successfully, but these errors were encountered: