diff --git a/towercore/guard.py b/towercore/guard.py index d515592..34f20f6 100755 --- a/towercore/guard.py +++ b/towercore/guard.py @@ -46,7 +46,7 @@ def should_block(frame: bytes) -> bool: def denied_response(frame: bytes) -> bytes: - message = b"not found" + message = b"operation not permitted" if frame[3] == 0x21 else b"not found" payload = (0x22).to_bytes(2, "little") + len(message).to_bytes(2, "little") + message return b"LT\x01\xfe" + frame[4:14] + len(payload).to_bytes(2, "little") + payload diff --git a/towercore/test_guard.py b/towercore/test_guard.py index 0492df2..d083e5e 100644 --- a/towercore/test_guard.py +++ b/towercore/test_guard.py @@ -89,7 +89,7 @@ class GuardTests(unittest.TestCase): response = module.denied_response(peer_request) self.assertEqual(response[3], 0xFE) self.assertEqual(response[4:14], peer_request[4:14]) - self.assertEqual(module.tlvs(response), [(0x22, b"not found")]) + self.assertEqual(module.tlvs(response), [(0x22, b"operation not permitted")]) def test_allows_attached_subscriber_reads(self) -> None: module = importlib.import_module("guard")