Skip to content

Commit 598bd82

Browse files
committed
More specific BadRequest error handling.
1 parent 7dde0bc commit 598bd82

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

async-http.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
2929
spec.add_dependency "io-endpoint", "~> 0.11"
3030
spec.add_dependency "io-stream", "~> 0.4"
3131
spec.add_dependency "protocol-http", "~> 0.28"
32-
spec.add_dependency "protocol-http1", "~> 0.19"
32+
spec.add_dependency "protocol-http1", "~> 0.20"
3333
spec.add_dependency "protocol-http2", "~> 0.18"
3434
spec.add_dependency "traces", ">= 0.10"
3535
end

lib/async/http/protocol/http1/server.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,9 @@ def next_request
3535
end
3636

3737
return request
38-
rescue Async::TimeoutError, IO::TimeoutError
39-
# For an interesting discussion about this behaviour, see https://trac.nginx.org/nginx/ticket/1005
40-
# If you enable this, you will see some spec failures...
41-
# fail_request(408)
42-
raise
43-
rescue
38+
rescue ::Protocol::HTTP1::BadRequest
4439
fail_request(400)
40+
# Conceivably we could retry here, but we don't really know how bad the error is, so it's better to just fail:
4541
raise
4642
end
4743

0 commit comments

Comments
 (0)