-
Notifications
You must be signed in to change notification settings - Fork 109
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
drill does not download the full body #182
Comments
So, I found a code fix for diff --git a/src/actions/request.rs b/src/actions/request.rs
index e81f427..2a2f1cd 100644
--- a/src/actions/request.rs
+++ b/src/actions/request.rs
@@ -293,17 +296,16 @@ impl Runnable for Request {
context.insert("cookies".to_string(), json!(cookies));
}
+ let mut headers = Map::new();
- let data = if let Some(ref key) = self.assign {
- let mut headers = Map::new();
-
- response.headers().iter().for_each(|(header, value)| {
- headers.insert(header.to_string(), json!(value.to_str().unwrap()));
- });
+ response.headers().iter().for_each(|(header, value)| {
+ headers.insert(header.to_string(), json!(value.to_str().unwrap()));
+ });
+ let body_data = response.text().await.unwrap();
- let data = response.text().await.unwrap();
+ let data = if let Some(ref key) = self.assign {
- let body: Value = serde_json::from_str(&data).unwrap_or(serde_json::Value::Null);
+ let body: Value = serde_json::from_str(&body_data).unwrap_or(serde_json::Value::Null);
let assigned = AssignedRequest {
status,
@@ -315,7 +317,7 @@ impl Runnable for Request {
context.insert(key.to_owned(), value);
- Some(data)
+ Some(body_data)
} else {
None
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm currently load-testing nginx with drill. It's always the same file, which is requested and always the same content delivered.
It came to my mind, that the logged
$body_bytes_sent
in the nginx access log vary from request to request. This should not be the case, since it's the same file.I'm running the current master and build it with:
cargo run --release -- --benchmark example/benchmark.yml
The file behind
/1m.bin
is 1 Megabyte of random data.As you can see, the body is only fully downloaded, if the body gets assigned. Obviously for some reasons, drill does behave different with the assign action.
I haven't been able to produce a working patch for drill yet, but the assign was my workaround.
What has to get patched, so that drill downloads the full file by default?
The text was updated successfully, but these errors were encountered: