Catch exception from misconfigured MMSC

Fixes #7339
fork-5.53.8
Moxie Marlinspike 2018-01-16 11:32:51 -08:00
rodzic 94e2b9e66e
commit fe02b3f8d3
1 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -48,14 +48,24 @@ public class IncomingLegacyMmsConnection extends LegacyMmsConnection implements
}
private HttpUriRequest constructRequest(Apn contentApn, boolean useProxy) throws IOException {
HttpGetHC4 request = new HttpGetHC4(contentApn.getMmsc());
HttpGetHC4 request;
try {
request = new HttpGetHC4(contentApn.getMmsc());
} catch (IllegalArgumentException e) {
// #7339
throw new IOException(e);
}
for (Header header : getBaseHeaders()) {
request.addHeader(header);
}
if (useProxy) {
HttpHost proxy = new HttpHost(contentApn.getProxy(), contentApn.getPort());
request.setConfig(RequestConfig.custom().setProxy(proxy).build());
}
return request;
}