Skip to content

Commit b652fa5

Browse files
authored
Merge pull request #206 from osyoyu/freeze-constants-for-ractor-compat
Freeze some constants to improve Ractor compatibility
2 parents d8fd39c + 9f0f5e4 commit b652fa5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/net/http.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ def use_ssl=(flag)
15291529
:verify_hostname,
15301530
] # :nodoc:
15311531

1532-
SSL_IVNAMES = SSL_ATTRIBUTES.map { |a| "@#{a}".to_sym } # :nodoc:
1532+
SSL_IVNAMES = SSL_ATTRIBUTES.map { |a| "@#{a}".to_sym }.freeze # :nodoc:
15331533

15341534
# Sets or returns the path to a CA certification file in PEM format.
15351535
attr_accessor :ca_file

lib/net/http/responses.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ class Net::HTTPResponse
11041104
'3' => Net::HTTPRedirection,
11051105
'4' => Net::HTTPClientError,
11061106
'5' => Net::HTTPServerError
1107-
}
1107+
}.freeze
11081108
CODE_TO_OBJ = {
11091109
'100' => Net::HTTPContinue,
11101110
'101' => Net::HTTPSwitchProtocol,
@@ -1170,5 +1170,5 @@ class Net::HTTPResponse
11701170
'508' => Net::HTTPLoopDetected,
11711171
'510' => Net::HTTPNotExtended,
11721172
'511' => Net::HTTPNetworkAuthenticationRequired,
1173-
}
1173+
}.freeze
11741174
end

0 commit comments

Comments
 (0)