From e3030cbbfd62e4a6a6e0365e4319e06647de1f95 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 24 Oct 2018 16:33:49 +0200 Subject: [PATCH] [InstagramBridge] Reduce occurrence of HTTP error 301 Instagram returns "HTTP/1.1 301 Moved Permanently" on each request to "https://instagram.com/" because the correct location is "https://www.instagram.com/". Instagram will respond with "HTTP/1.1 301 Moved Permanently" if the URI for the requested user doesn't end with a slash. Notice: This is only a minor enhancement to prevent error 301 from happening. The previous version worked fine as is. --- bridges/InstagramBridge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php index 226d453e..a4473822 100644 --- a/bridges/InstagramBridge.php +++ b/bridges/InstagramBridge.php @@ -3,7 +3,7 @@ class InstagramBridge extends BridgeAbstract { const MAINTAINER = 'pauder'; const NAME = 'Instagram Bridge'; - const URI = 'https://instagram.com/'; + const URI = 'https://www.instagram.com/'; const DESCRIPTION = 'Returns the newest images'; const PARAMETERS = array( @@ -143,7 +143,7 @@ class InstagramBridge extends BridgeAbstract { public function getURI(){ if(!is_null($this->getInput('u'))) { - return self::URI . urlencode($this->getInput('u')); + return self::URI . urlencode($this->getInput('u')) . '/'; } elseif(!is_null($this->getInput('h'))) { return self::URI . 'explore/tags/' . urlencode($this->getInput('h')); }