Exploit::Remote::HttpServer NameError

The variable "sock" doesn't seems to exit in this context.
This cause the method to throw a "NameError" (when using the "get_uri" method, in my case).

I'm not sure if this variable NEVER exist in the context, so I just added a verification.