From 538c6ce4b9f4aa46926641f6245957d7fb5d35ed Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 16 Nov 2010 16:14:04 -0800 Subject: [PATCH] Take handle validations out of em-webfinger --- lib/em-webfinger.rb | 4 ++-- spec/lib/em-webfinger_spec.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/em-webfinger.rb b/lib/em-webfinger.rb index f6a3539f7..60f23d182 100644 --- a/lib/em-webfinger.rb +++ b/lib/em-webfinger.rb @@ -8,9 +8,9 @@ class EMWebfinger @callbacks = [] @ssl = true # Raise an error if identifier has a port number - raise "Identifier is invalid" if(@account.strip.match(/\:\d+$/)) + #raise "Identifier is invalid" if(@account.strip.match(/\:\d+$/)) # Raise an error if identifier is not a valid email (generous regexp) - raise "Identifier is invalid" if !(@account=~ /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/) + #raise "Identifier is invalid" if !(@account=~ /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/) end def fetch raise 'you need to set a callback before calling fetch' if @callbacks.empty? diff --git a/spec/lib/em-webfinger_spec.rb b/spec/lib/em-webfinger_spec.rb index 35159bae1..f31b6cb5c 100644 --- a/spec/lib/em-webfinger_spec.rb +++ b/spec/lib/em-webfinger_spec.rb @@ -43,6 +43,7 @@ describe EMWebfinger do end it 'should not allow port numbers' do + pending proc{ EMWebfinger.new('eviljoe@diaspora.local:3000') }.should raise_error(RuntimeError, "Identifier is invalid")