The reason is to keep exactly the same behavior than previously and return the same throw message than before.
Otherwise, the throw could be different and be the one of the JHttpFactory.

So just for compatibility, I have verified the environment before calling the JHttpFactory.

Otherwise, the refactoring would have also removed the test before reader->open and replace it by the new code that I have provided in the else and that is able to work with allow_url_open off but also use the curl when present and the socket and available.

This is just for compatibility with previous behavior that I did the test of the environment.