-
-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whois::Server::Adapters::Base.query_handler= no longer working #558
Comments
That was not intentional. Can you provide some more hint on how you use it and what's happening? Which version specifically broke it? |
It looks like it happened between 3.6.5 and 4.0.1 and I'm using it like
this:
```
class MyHandler
def self.call(query, *args)
# cose in here doesn't execute on lookup anymore
end
end
Whois::Server::Adapters::Base.query_handler = MyHandler
```
…On Mon, Jul 17, 2017 at 4:36 PM, Simone Carletti ***@***.***> wrote:
That was not intentional.
Can you provide some more hint on how you use it and what's happening?
Which version specifically broke it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#558 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA1afM9uo11rCfsF8FRe-Sny0wXIN_Zlks5sOx0WgaJpZM4OZdch>
.
|
OK, thanks. I'll take a look. |
Hello. I hit this bug report and I had the chance to look into the code. Unless I'm mistaken the problem is that in a class method, a instance variable has been used. Then the fix is
With this patch I can use the code
Can you confirm the patch is working for you? Any chance it can be fixed? |
I also found a temporary solution that fixes the use of custom query handlers: Whois::Server::Adapters::Base.query_handler =
Whois::Server::Adapters::Afilias.query_handler =
Whois::Server::Adapters::Arin.query_handler =
Whois::Server::Adapters::Arpa.query_handler =
Whois::Server::Adapters::Formatted.query_handler =
Whois::Server::Adapters::None.query_handler =
Whois::Server::Adapters::Standard.query_handler =
Whois::Server::Adapters::Verisign.query_handler =
Whois::Server::Adapters::Web.query_handler =
MyWhoisQueryHandler Forcing the query handler on all adapters makes the things work. However this is not a fix but a workaround. The fix is to use a class variable, as pointed out above. Can you fix it yourself or do you prefer a PR? |
I used to be able to hook into that to do some custom stuff but it doesn't do anything anymore.
Is there any way to bring this back?
The text was updated successfully, but these errors were encountered: