Skip to content

Commit 8fd469d

Browse files
bellebaumanakinj
authored andcommitted
JWK: Replace Hash#except for older Rubies
1 parent a6e2ac0 commit 8fd469d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/jwt/jwk/ec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def members
4747

4848
def export(options = {})
4949
exported = parameters.clone
50-
exported = exported.except(*EC_PRIVATE_KEY_ELEMENTS) unless private? && options[:include_private] == true
50+
exported.reject! { |k, _| EC_PRIVATE_KEY_ELEMENTS.include? k } unless private? && options[:include_private] == true
5151
exported
5252
end
5353

lib/jwt/jwk/hmac.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def public_key
4242
# See https://tools.ietf.org/html/rfc7517#appendix-A.3
4343
def export(options = {})
4444
exported = parameters.clone
45-
exported = exported.except(*HMAC_PRIVATE_KEY_ELEMENTS) unless private? && options[:include_private] == true
45+
exported.reject! { |k, _| HMAC_PRIVATE_KEY_ELEMENTS.include? k } unless private? && options[:include_private] == true
4646
exported
4747
end
4848

lib/jwt/jwk/rsa.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def public_key
4242

4343
def export(options = {})
4444
exported = parameters.clone
45-
exported = exported.except(*RSA_PRIVATE_KEY_ELEMENTS) unless private? && options[:include_private] == true
45+
exported.reject! { |k, _| RSA_PRIVATE_KEY_ELEMENTS.include? k } unless private? && options[:include_private] == true
4646
exported
4747
end
4848

0 commit comments

Comments
 (0)