File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -76,18 +76,14 @@ def __init__(
76
76
raise ValueError ("Unparseable raw_request: " , raw_request ) from exc
77
77
78
78
# If ? is found in path, strip form data for matching route
79
- try :
80
- idx = self .path .index ('?' )
81
- except ValueError :
82
- idx = len (self .path )
83
- self .form = self .path [:idx ]
79
+ self .form = self .path .split ('?' )[0 ]
84
80
85
81
def __hash__ (self ) -> int :
86
- return hash (self .method ) ^ hash (self .path )
82
+ return hash (self .method ) ^ hash (self .form )
87
83
88
84
def __eq__ (self , other : "_HTTPRequest" ) -> bool :
89
85
# Match path found in decorator with form from the actual request,
90
- return self .method == other .method and self .path == other .form
86
+ return self .method == other .method and self .form == other .form
91
87
92
88
def __repr__ (self ) -> str :
93
89
return f"_HTTPRequest(path={ repr (self .path )} , method={ repr (self .method )} , form={ repr (self .form )} )"
You can’t perform that action at this time.
0 commit comments