File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def initialize(app)
6
6
def call ( env )
7
7
status , headers , response = @app . call ( env )
8
8
9
- if html_response? ( headers )
9
+ if interceptable_request? ( headers ) && html_response? ( headers )
10
10
@request = ActionDispatch ::Request . new ( env )
11
11
html = html_from ( response )
12
12
html = inject_javascript ( html )
@@ -19,6 +19,10 @@ def call(env)
19
19
end
20
20
21
21
private
22
+ def interceptable_request? ( headers )
23
+ headers [ "action_controller.instance" ]
24
+ end
25
+
22
26
def html_response? ( headers )
23
27
headers [ "Content-Type" ] &.include? ( "text/html" )
24
28
end
Original file line number Diff line number Diff line change
1
+ require "application_system_test_case"
2
+
3
+ class MiddlewareTest < ActionDispatch ::IntegrationTest
4
+ test "error" do
5
+ get "/redirected"
6
+ end
7
+ end
You can’t perform that action at this time.
0 commit comments