Skip to content

Commit d19ef31

Browse files
committed
WIP
1 parent e796678 commit d19ef31

File tree

6 files changed

+12
-1
lines changed

6 files changed

+12
-1
lines changed

config/sus.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55

66
require "covered/sus"
77
include Covered::Sus
8+
9+
require "async/safe"
10+
Async::Safe.enable!

gems.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@
3232

3333
gem "bake-test"
3434
gem "bake-test-external"
35+
36+
gem "async-safe"
3537
end

lib/protocol/http/accept_encoding.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AcceptEncoding < Middleware
2525

2626
# There is no point including this:
2727
# 'identity' => ->(body){body},
28-
}
28+
}.freeze
2929

3030
# Initialize the middleware with the given delegate and wrappers.
3131
#

lib/protocol/http/body/buffered.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module HTTP
1212
module Body
1313
# A body which buffers all its contents.
1414
class Buffered < Readable
15+
ASYNC_SAFE = {initialize: true}.freeze
16+
1517
# Tries to wrap an object in a {Buffered} instance.
1618
#
1719
# For compatibility, also accepts anything that behaves like an `Array(String)`.

lib/protocol/http/body/stream.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module HTTP
1212
module Body
1313
# The input stream is an IO-like object which contains the raw HTTP POST data. When applicable, its external encoding must be “ASCII-8BIT” and it must be opened in binary mode, for Ruby 1.9 compatibility. The input stream must respond to gets, each, read and rewind.
1414
class Stream
15+
ASYNC_SAFE = {initialize: true}.freeze
16+
1517
# The default line separator, used by {gets}.
1618
NEWLINE = "\n"
1719

lib/protocol/http/body/writable.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module HTTP
1010
module Body
1111
# A dynamic body which you can write to and read from.
1212
class Writable < Readable
13+
ASYNC_SAFE = true
14+
1315
# An error indicating that the body has been closed and no further writes are allowed.
1416
class Closed < StandardError
1517
end

0 commit comments

Comments
 (0)