diff --git a/CHANGELOG.md b/CHANGELOG.md index e5619896..e184acb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Fix a regression introduced in `0.17.0` causing `before_worker_exit` to often not be called. - Implemented the `max_consecutive_spawn_errors` configuration. Purely opt-in for now. - Properly handle magic comments in `config.ru`. +- Execute `rack.response_finished` callbacks in reverse order of registration # 0.17.0 diff --git a/lib/pitchfork/http_server.rb b/lib/pitchfork/http_server.rb index ca56bfbf..8cca7971 100644 --- a/lib/pitchfork/http_server.rb +++ b/lib/pitchfork/http_server.rb @@ -893,7 +893,7 @@ def process_client(client, worker, timeout_handler) env ensure if env - env["rack.response_finished"].each do |callback| + env["rack.response_finished"].reverse_each do |callback| if callback.arity == 0 callback.call else