1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Merge pull request #2378 from BlakeWilliams/race-condition

Fix middleware request uri race condition
This commit is contained in:
Thomas Walpole 2020-08-09 15:27:25 -07:00 committed by GitHub
commit 1895bfe837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,14 +53,16 @@ module Capybara
if env['PATH_INFO'] == '/__identify__'
[200, {}, [@app.object_id.to_s]]
else
@counter.increment(env['REQUEST_URI'])
request_uri = env['REQUEST_URI']
@counter.increment(request_uri)
begin
@extended_app.call(env)
rescue *@server_errors => e
@error ||= e
raise e
ensure
@counter.decrement(env['REQUEST_URI'])
@counter.decrement(request_uri)
end
end
end