File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,22 @@ def __init__(
75
75
except ValueError as exc :
76
76
raise ValueError ("Unparseable raw_request: " , raw_request ) from exc
77
77
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 ]
84
+
78
85
def __hash__ (self ) -> int :
79
86
return hash (self .method ) ^ hash (self .path )
80
87
81
88
def __eq__ (self , other : "_HTTPRequest" ) -> bool :
82
- return self .method == other .method and self .path == other .path
89
+ # Match path found in decorator with form from the actual request,
90
+ return self .method == other .method and self .path == other .form
83
91
84
92
def __repr__ (self ) -> str :
85
- return f"_HTTPRequest(path={ repr (self .path )} , method={ repr (self .method )} )"
93
+ return f"_HTTPRequest(path={ repr (self .path )} , method={ repr (self .method )} , form= { repr ( self . form ) } )"
86
94
87
95
88
96
class MIMEType :
You can’t perform that action at this time.
0 commit comments