Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit 3c9d63b

Browse files
committed
add auto_redirect
1 parent c637a8b commit 3c9d63b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/org/codelibs/riverweb/RiverWeb.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ private int crawl(Crawler crawler, String configId, String sessionId) {
298298
final Boolean robotsTxtEnabled = SettingsUtils.get(crawlSettings, "robots_txt", config.isRobotsTxtEnabled());
299299
paramMap.put(HcHttpClient.ROBOTS_TXT_ENABLED_PROPERTY, robotsTxtEnabled);
300300

301+
// redirect automatically
302+
final Boolean redirectsEnabled = SettingsUtils.get(crawlSettings, "auto_redirect", config.isRedirectsEnabled());
303+
paramMap.put(HcHttpClient.REDIRECTS_ENABLED, redirectsEnabled);
304+
301305
// proxy
302306
final Map<String, Object> proxyMap = SettingsUtils.get(crawlSettings, "proxy", null);
303307
if (proxyMap != null) {

src/main/java/org/codelibs/riverweb/util/ConfigProperties.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public boolean isRobotsTxtEnabled() {
3838
return Boolean.valueOf(getProperty("robots.txt.enabled", Boolean.TRUE.toString()));
3939
}
4040

41+
public boolean isRedirectsEnabled() {
42+
return Boolean.valueOf(getProperty("auto.redirect.enabled", Boolean.FALSE.toString()));
43+
}
44+
4145
public Integer getConnectionTimeout() {
4246
String value = getProperty("timeout.connection");
4347
if (StringUtil.isNotBlank(value)) {

0 commit comments

Comments
 (0)