mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:16:09 -04:00
Return an empty body for OPTIONS requests. (#7886)
This commit is contained in:
parent
1ec688bf21
commit
6a080ea184
3 changed files with 12 additions and 25 deletions
|
@ -193,10 +193,10 @@ class OptionsResourceTests(unittest.TestCase):
|
|||
return channel
|
||||
|
||||
def test_unknown_options_request(self):
|
||||
"""An OPTIONS requests to an unknown URL still returns 200 OK."""
|
||||
"""An OPTIONS requests to an unknown URL still returns 204 No Content."""
|
||||
channel = self._make_request(b"OPTIONS", b"/foo/")
|
||||
self.assertEqual(channel.result["code"], b"200")
|
||||
self.assertEqual(channel.result["body"], b"{}")
|
||||
self.assertEqual(channel.result["code"], b"204")
|
||||
self.assertNotIn("body", channel.result)
|
||||
|
||||
# Ensure the correct CORS headers have been added
|
||||
self.assertTrue(
|
||||
|
@ -213,10 +213,10 @@ class OptionsResourceTests(unittest.TestCase):
|
|||
)
|
||||
|
||||
def test_known_options_request(self):
|
||||
"""An OPTIONS requests to an known URL still returns 200 OK."""
|
||||
"""An OPTIONS requests to an known URL still returns 204 No Content."""
|
||||
channel = self._make_request(b"OPTIONS", b"/res/")
|
||||
self.assertEqual(channel.result["code"], b"200")
|
||||
self.assertEqual(channel.result["body"], b"{}")
|
||||
self.assertEqual(channel.result["code"], b"204")
|
||||
self.assertNotIn("body", channel.result)
|
||||
|
||||
# Ensure the correct CORS headers have been added
|
||||
self.assertTrue(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue