Skip to content

Commit

Permalink
fix: Update micro-http for empty MMDS path
Browse files Browse the repository at this point in the history
When querying a MMDS path that has an empty content, the response didn't
contain 'Content-Length' field, resulting in the client waiting for the
connection closed by the server or timeout. To fix this issue,
micro-http made a change to have the field when the response status code
is not 1XX or 204. This commit updates Cargo.lock file to consume this
change and also adds an integration test to ensure that it doesn't
timeout for an empty MMDS path.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
  • Loading branch information
zulinx86 committed Feb 21, 2024
1 parent 7da42c1 commit 7864c84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion tests/integration_tests/functional/test_mmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def test_mmds_response(uvm_plain, version):
"res_key": "res_value",
},
"dummy_array": ["arr_val1", "arr_val2"],
"dummy_empty": "",
},
"Limits": {"CPU": 512, "Memory": 512},
"Usage": {"CPU": 12.12},
Expand Down Expand Up @@ -328,12 +329,12 @@ def test_mmds_response(uvm_plain, version):
expected = (
"ami-id\n"
"dummy_array\n"
"dummy_empty\n"
"dummy_obj/\n"
"local-hostname\n"
"public-hostname\n"
"reservation-id"
)

run_guest_cmd(ssh_connection, cmd, expected)

cmd = pre + "latest/meta-data/ami-id/"
Expand All @@ -342,6 +343,9 @@ def test_mmds_response(uvm_plain, version):
cmd = pre + "latest/meta-data/dummy_array/0"
run_guest_cmd(ssh_connection, cmd, "arr_val1")

cmd = pre + "latest/meta-data/dummy_empty"
run_guest_cmd(ssh_connection, cmd, "")

cmd = pre + "latest/Usage/CPU"
run_guest_cmd(
ssh_connection,
Expand Down

0 comments on commit 7864c84

Please sign in to comment.