mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 00:30:31 +00:00
fix http referer for trip endpoint in Vienna
This commit is contained in:
parent
fdb905c195
commit
bfb3b64eca
2 changed files with 10 additions and 2 deletions
|
@ -94,6 +94,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
private boolean includeRegionId = true;
|
||||
private Charset requestUrlEncoding = ISO_8859_1;
|
||||
private String httpReferer = null;
|
||||
private String httpRefererTrip = null;
|
||||
private boolean httpPost = false;
|
||||
private boolean suppressPositions = false;
|
||||
private boolean useRouteIndexAsConnectionId = true;
|
||||
|
@ -166,6 +167,12 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
protected void setHttpReferer(final String httpReferer)
|
||||
{
|
||||
this.httpReferer = httpReferer;
|
||||
this.httpRefererTrip = httpReferer;
|
||||
}
|
||||
|
||||
public void setHttpRefererTrip(final String httpRefererTrip)
|
||||
{
|
||||
this.httpRefererTrip = httpRefererTrip;
|
||||
}
|
||||
|
||||
protected void setHttpPost(final boolean httpPost)
|
||||
|
@ -1885,7 +1892,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
InputStream is = null;
|
||||
try
|
||||
{
|
||||
is = ParserUtils.scrapeInputStream(uri.toString(), httpPost ? parameters.substring(1) : null, null, httpReferer, "NSC_", 3);
|
||||
is = ParserUtils.scrapeInputStream(uri.toString(), httpPost ? parameters.substring(1) : null, null, httpRefererTrip, "NSC_", 3);
|
||||
return queryConnections(uri.toString(), is);
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
|
@ -1916,7 +1923,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
InputStream is = null;
|
||||
try
|
||||
{
|
||||
is = new BufferedInputStream(ParserUtils.scrapeInputStream(uri.toString(), null, null, httpReferer, "NSC_", 3));
|
||||
is = new BufferedInputStream(ParserUtils.scrapeInputStream(uri.toString(), null, null, httpRefererTrip, "NSC_", 3));
|
||||
is.mark(512);
|
||||
|
||||
return queryConnections(uri.toString(), is);
|
||||
|
|
|
@ -35,6 +35,7 @@ public class VorProvider extends AbstractEfaProvider
|
|||
super(API_BASE);
|
||||
|
||||
setHttpReferer(API_BASE + DEFAULT_DEPARTURE_MONITOR_ENDPOINT);
|
||||
setHttpRefererTrip(API_BASE + DEFAULT_TRIP_ENDPOINT);
|
||||
setHttpPost(true);
|
||||
setIncludeRegionId(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue