diff --git a/spec/01-unit/05-utils_spec.lua b/spec/01-unit/05-utils_spec.lua index f93d682f4f89..ad4ec5a365ca 100644 --- a/spec/01-unit/05-utils_spec.lua +++ b/spec/01-unit/05-utils_spec.lua @@ -181,6 +181,11 @@ describe("Utils", function() end) it("test parsing directive header", function() + -- EMPTY table return by the function with `nil` should be read-only + assert.is_false(pcall(function() + tools_http.parse_directive_header(nil)["foo"] = "bar" + end)) + -- test null assert.same(tools_http.parse_directive_header(nil), {})