File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
actionpack/lib/action_dispatch Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -157,11 +157,16 @@ def request_method
157
157
#
158
158
# request.route_uri_pattern # => "/:controller(/:action(/:id))(.:format)"
159
159
def route_uri_pattern
160
- get_header ( "action_dispatch.route_uri_pattern" )
160
+ unless pattern = get_header ( "action_dispatch.route_uri_pattern" )
161
+ route = get_header ( "action_dispatch.route" )
162
+ pattern = route . path . spec . to_s
163
+ set_header ( "action_dispatch.route_uri_pattern" , pattern )
164
+ end
165
+ pattern
161
166
end
162
167
163
- def route_uri_pattern = ( pattern ) # :nodoc:
164
- set_header ( "action_dispatch.route_uri_pattern " , pattern )
168
+ def route = ( route ) # :nodoc:
169
+ set_header ( "action_dispatch.route " , route )
165
170
end
166
171
167
172
def routes # :nodoc:
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def serve(req)
43
43
}
44
44
45
45
req . path_parameters = tmp_params
46
- req . route_uri_pattern = route . path . spec . to_s
46
+ req . route = route
47
47
48
48
_ , headers , _ = response = route . app . serve ( req )
49
49
You can’t perform that action at this time.
0 commit comments