[FacebookBridge] Reduce occurrence of HTTP error 302

Facebook returns "HTTP/1.1 302 Found" when requesting:
  https://www.facebook.com//pg/username/posts?_fb_noscript=1
Automatically redirecting to:
  https://www.facebook.com/username/posts/

We receive a positive response faster when directly requesting the
correct page:
  https://www.facebook.com/username/posts?_fb_noscript=1

Notice: This is just a minor adjustment to improve performance while
requesting data from the server. The previous version worked fine as
well.
This commit is contained in:
logmanoriginal 2018-10-24 17:23:09 +02:00
parent e3030cbbfd
commit c56f7abc2a

View file

@ -95,7 +95,7 @@ class FacebookBridge extends BridgeAbstract {
$user = $this->sanitizeUser($this->getInput('u')); $user = $this->sanitizeUser($this->getInput('u'));
if(!strpos($user, '/')) { if(!strpos($user, '/')) {
$uri .= '/pg/' . urlencode($user) . '/posts'; $uri .= urlencode($user) . '/posts';
} else { } else {
$uri .= 'pages/' . $user; $uri .= 'pages/' . $user;
} }