Skip to content

Commit

Permalink
Merge pull request #411 from ajkannan/fix-socket-api-bug
Browse files Browse the repository at this point in the history
Avoid throwing exception when checking isLocalHost in Datastore
  • Loading branch information
aozarov committed Nov 24, 2015
2 parents a27282e + fc2ab10 commit d8a6159
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
import org.json.JSONTokener;

import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -95,7 +93,7 @@ private static boolean isLocalHost(String host) {
}
InetAddress hostAddr = InetAddress.getByName(new URL(normalizedHost).getHost());
return hostAddr.isAnyLocalAddress() || hostAddr.isLoopbackAddress();
} catch (UnknownHostException | MalformedURLException e) {
} catch (Exception e) {
// ignore
}
}
Expand Down

0 comments on commit d8a6159

Please sign in to comment.