Skip to content

Commit eff8b04

Browse files
authored
Merge pull request #175 from Shopify/ac-response-finished-order
Execute `rack.response_finished` callbacks in reverse order of registration
2 parents fdc0a49 + 2cdf0ad commit eff8b04

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Fix a regression introduced in `0.17.0` causing `before_worker_exit` to often not be called.
44
- Implemented the `max_consecutive_spawn_errors` configuration. Purely opt-in for now.
55
- Properly handle magic comments in `config.ru`.
6+
- Execute `rack.response_finished` callbacks in reverse order of registration
67

78
# 0.17.0
89

lib/pitchfork/http_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ def process_client(client, worker, timeout_handler)
893893
env
894894
ensure
895895
if env
896-
env["rack.response_finished"].each do |callback|
896+
env["rack.response_finished"].reverse_each do |callback|
897897
if callback.arity == 0
898898
callback.call
899899
else

0 commit comments

Comments
 (0)