aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2016-02-03 21:25:34 +0100
committerChristian Weiske <cweiske@cweiske.de>2016-02-03 21:25:34 +0100
commit18dc4a1560c24ffd70d659ef1a96caf90ec9a4c8 (patch)
tree276782d7e3b94d1b47a37de038cd8c52a70658af /bin
parent88c741c09b664260f826ff947bfaab071ac70d05 (diff)
downloadphinde-18dc4a1560c24ffd70d659ef1a96caf90ec9a4c8.tar.gz
phinde-18dc4a1560c24ffd70d659ef1a96caf90ec9a4c8.zip
follow redirect, do not verify ssl certificates, use final after-redirect url
Diffstat (limited to 'bin')
-rwxr-xr-xbin/index.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/index.php b/bin/index.php
index 8ac08ce..dd32dea 100755
--- a/bin/index.php
+++ b/bin/index.php
@@ -24,11 +24,11 @@ if ($existingDoc && $existingDoc->status == 'indexed') {
}
//FIXME: sourcetitle, sourcelink
-//FIXME: enable redirects
-//FIXME: enable ssl
$req = new \HTTP_Request2($url);
+$req->setConfig('follow_redirects', true);
$req->setConfig('connect_timeout', 5);
$req->setConfig('timeout', 10);
+$req->setConfig('ssl_verify_peer', false);
$res = $req->send();
//FIXME: try-catch
@@ -49,7 +49,7 @@ if (!in_array($mimetype, $supportedIndexTypes)) {
//FIXME: update index only if changed since last index time
//FIXME: extract base url from html
-//FIXME: use final URL after redirects
+$url = $res->getEffectiveUrl();
$base = new \Net_URL2($url);
$indexDoc = new \stdClass();