-
Notifications
You must be signed in to change notification settings - Fork 520
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
Add --max-filesize option to limit HTTP response #2468
Conversation
010b1d4
to
65ecb0f
Compare
65ecb0f
to
e2d8a87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The option max_filesize
should also work for [Options]
section:
GET https://foo.com
output: bar.bin
max-filesize: 128000
HTTP 200
cc06348
to
6585988
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @baerwang
To make the CI OK, you should look at the integration test tests_ok/help.sh
: this is a simple test that checks the output of hurl --help
. When adding a new option, we must update this test.
6585988
to
95875d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnryResult
struct doesn't need to change. max_filesize
must be passed to run method (with RunnerOptions
) so we can configure libcurl to use it. This way we don't have to check the dfile size when we write a response: the exchange will be in error if the file size is greater than the optiions.
Ho @baerwang I can help with this PR and push some fixes if you want! |
i'll changed this code at sunday |
95875d6
to
ffea141
Compare
ffea141
to
4f7d12b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use an Option<usize>
instead of a usize
for max_filesize
fields.
4f7d12b
to
2f535d8
Compare
2f535d8
to
7029b5b
Compare
Hi @baerwang if it's ok with you, I'm doing some minor changes on your branch to finish it |
/accept --force |
🕗 /accept --force is running, please wait for completion. |
✅ Pull request merged without waiting for checks and closed by
|
Thanks @baerwang for this PR |
#2353
develop process
options
cargo clippy
tests_ok/help.sh