1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
Origin: https://github.com/ruby-json-schema/json-schema/commit/4ed4025e418ced4c207580b855d173ee3c99509c.patch
Forwarded: https://github.com/ruby-json-schema/json-schema/pull/437
Bug: https://github.com/ruby-json-schema/json-schema/issues/430
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=952019
From: Luke Rodgers <lukeasrodgers@gmail.com>
Date: Sun, 26 May 2019 21:45:45 -0400
Subject: [PATCH] Rescue IPAddr::InvalidAddressError
As of ruby 2.6 the error raise here includes a string with the offending
IP in it, which causes the matching to fail. We could just ditch string
matching altogether except for 1.9.3 support, which raises a generic
ArugmentError.
---
lib/json-schema/attributes/formats/ip.rb | 1 +
1 file changed, 1 insertion(+)
--- a/lib/json-schema/attributes/formats/ip.rb
+++ b/lib/json-schema/attributes/formats/ip.rb
@@ -10,6 +10,7 @@
begin
ip = IPAddr.new(data)
+ rescue IPAddr::InvalidAddressError
rescue ArgumentError => e
raise e unless e.message == 'invalid address'
end
|