File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 36
36
from .log import ws_logger
37
37
from .streams import EofStream
38
38
from .typedefs import JSONDecoder , JSONEncoder
39
- from .web_exceptions import HTTPBadRequest , HTTPException
39
+ from .web_exceptions import HTTPBadRequest , HTTPException , HTTPMethodNotAllowed
40
40
from .web_request import BaseRequest
41
41
from .web_response import StreamResponse
42
42
@@ -226,6 +226,9 @@ def _handshake(
226
226
self , request : BaseRequest
227
227
) -> Tuple ["CIMultiDict[str]" , Optional [str ], int , bool ]:
228
228
headers = request .headers
229
+ if request .method != hdrs .METH_GET :
230
+ raise HTTPMethodNotAllowed (request .method , {hdrs .METH_GET })
231
+
229
232
if "websocket" != headers .get (hdrs .UPGRADE , "" ).lower ().strip ():
230
233
raise HTTPBadRequest (
231
234
text = (
You can’t perform that action at this time.
0 commit comments