rtc_backend/utils/routers.py
repair-agent 7a6d7814e0
Some checks failed
Build and Deploy Backend / build-and-deploy (push) Failing after 57s
fix store bug
2026-02-12 14:05:51 +08:00

10 lines
290 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from rest_framework.routers import DefaultRouter
class OptionalSlashRouter(DefaultRouter):
"""尾部斜杠可选的 Router兼容 /path 和 /path/ 两种形式"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.trailing_slash = '/?'