📝 Make sure that `SSE` validation for events work correctly, including custom types and `validate_events=False` (#1329)
django-modern-rest/dmr/streaming/sse/metadata.py
Lines 169 to 175 in a2d44b1
Currently we have two problems:
1. Even when
validate_events=False, we still validate that id and event fields for SSEvent does not contain NULL char and does not contain multiline strings. Which is not really cool. Why? Beceause we slow things down in production, when users explicitly ask us not to. We need to move the validation somewhere else. I propose moving this login into the validator or renderer. But, it must respect the setting. Even if some field is not valid in production, it must not be validated if validate_events=False2. Currently custom SSE event types are not validated the same way. It would be automatically solved, when
1. is fixed. We would just need more tests for this :)(please, do not take this issue before the 1st of September)
#bug #good_first_issue #help_wanted #opensource_september #django_modern_rest
sent via relator