Skip to content

Commit

Permalink
chore: fix fake node sub
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Aug 25, 2024
1 parent ca9384b commit a7dd002
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods
from django.db.models.query import QuerySet

from apps.ext import lock
from apps.proxy import models as m
Expand Down Expand Up @@ -99,7 +100,10 @@ def get(self, request):
node_list = response_or_nodes

if protocol := request.GET.get("protocol"):
if protocol in m.ProxyNode.NODE_TYPE_SET:
if (
protocol in m.ProxyNode.NODE_TYPE_SET
and type(node_list) is QuerySet
):
node_list = node_list.filter(node_type=protocol)

sub_client = request.GET.get("client")
Expand Down

0 comments on commit a7dd002

Please sign in to comment.