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

Commit

Permalink
add auto_redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed May 30, 2016
1 parent c637a8b commit 3c9d63b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/codelibs/riverweb/RiverWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ private int crawl(Crawler crawler, String configId, String sessionId) {
final Boolean robotsTxtEnabled = SettingsUtils.get(crawlSettings, "robots_txt", config.isRobotsTxtEnabled());
paramMap.put(HcHttpClient.ROBOTS_TXT_ENABLED_PROPERTY, robotsTxtEnabled);

// redirect automatically
final Boolean redirectsEnabled = SettingsUtils.get(crawlSettings, "auto_redirect", config.isRedirectsEnabled());
paramMap.put(HcHttpClient.REDIRECTS_ENABLED, redirectsEnabled);

// proxy
final Map<String, Object> proxyMap = SettingsUtils.get(crawlSettings, "proxy", null);
if (proxyMap != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public boolean isRobotsTxtEnabled() {
return Boolean.valueOf(getProperty("robots.txt.enabled", Boolean.TRUE.toString()));
}

public boolean isRedirectsEnabled() {
return Boolean.valueOf(getProperty("auto.redirect.enabled", Boolean.FALSE.toString()));
}

public Integer getConnectionTimeout() {
String value = getProperty("timeout.connection");
if (StringUtil.isNotBlank(value)) {
Expand Down

0 comments on commit 3c9d63b

Please sign in to comment.