Skip to content

Commit

Permalink
handle path arguments correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Apr 2, 2021
1 parent 30caa40 commit a9a216b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/flask_sock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from functools import wraps
from flask import Blueprint, request, abort
from .ws import WebSocket, ConnectionClosed

Expand All @@ -18,9 +19,10 @@ def init_app(self, app):

def route(self, path, **kwargs):
def decorator(f):
def websocket_route():
@wraps(f)
def websocket_route(*args, **kwargs):
try:
f(WebSocket(request.environ))
f(WebSocket(request.environ), *args, **kwargs)
except ConnectionClosed:
pass
return ''
Expand Down

0 comments on commit a9a216b

Please sign in to comment.