diff --git a/falcon/responders.py b/falcon/responders.py index b5f6186..34da807 100644 --- a/falcon/responders.py +++ b/falcon/responders.py @@ -58,5 +58,6 @@ def create_default_options(allowed_methods): def on_options(req, resp, **kwargs): resp.status = HTTP_204 resp.set_header('Allow', allowed) + resp.set_header('Content-Length', '0') return on_options diff --git a/tests/test_headers.py b/tests/test_headers.py index 8880992..838755d 100644 --- a/tests/test_headers.py +++ b/tests/test_headers.py @@ -534,6 +534,12 @@ class TestHeaders(testing.TestCase): self._check_link_header(resource, expected_value) + def test_content_length_options(self): + result = self.simulate_options() + + content_length = '0' + self.assertEqual(result.headers['Content-Length'], content_length) + # ---------------------------------------------------------------------- # Helpers # ----------------------------------------------------------------------