mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 16:59:51 +00:00
second criteria for html detection
This commit is contained in:
parent
b39a94ea2c
commit
5626136212
1 changed files with 11 additions and 2 deletions
|
@ -543,7 +543,6 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
final XmlPullParser pp = parserFactory.newPullParser();
|
||||
pp.setInput(is, null);
|
||||
// pp.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, false);
|
||||
final ResultHeader header = enterItdRequest(pp);
|
||||
|
||||
if (!XmlPullUtil.jumpToStartTag(pp, null, "itdOdv") || !"dm".equals(pp.getAttributeValue(null, "usage")))
|
||||
|
@ -2335,8 +2334,18 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
private ResultHeader enterItdRequest(final XmlPullParser pp) throws XmlPullParserException, IOException
|
||||
{
|
||||
if (pp.getEventType() == XmlPullParser.START_DOCUMENT)
|
||||
if (pp.getEventType() != XmlPullParser.START_DOCUMENT)
|
||||
throw new IllegalStateException("start of document expected");
|
||||
|
||||
try
|
||||
{
|
||||
pp.next();
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
{
|
||||
if (x.getMessage().startsWith("Expected a quoted string"))
|
||||
throw new ProtocolException("html");
|
||||
}
|
||||
|
||||
if (pp.getEventType() == XmlPullParser.DOCDECL)
|
||||
pp.next();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue