Skip to content

Commit

Permalink
fix(subscription): only save vpn app user-agents (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMohammad20000 authored Nov 9, 2024
1 parent b51afe7 commit b76dc2b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/routers/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def user_subscription(
):
"""Provides a subscription link based on the user agent (Clash, V2Ray, etc.)."""
user: UserResponse = UserResponse.from_orm(dbuser)
crud.update_user_sub(db, dbuser, user_agent)

accept_header = request.headers.get("Accept", "")
if "text/html" in accept_header:
Expand All @@ -66,6 +65,7 @@ def user_subscription(
)
)

crud.update_user_sub(db, dbuser, user_agent)
response_headers = {
"content-disposition": f'attachment; filename="{user.username}"',
"profile-web-page-url": str(request.url),
Expand Down Expand Up @@ -161,7 +161,6 @@ def user_subscription_with_client_type(
):
"""Provides a subscription link based on the specified client type (e.g., Clash, V2Ray)."""
user: UserResponse = UserResponse.from_orm(dbuser)
crud.update_user_sub(db, dbuser, user_agent)

response_headers = {
"content-disposition": f'attachment; filename="{user.username}"',
Expand Down

0 comments on commit b76dc2b

Please sign in to comment.