Mosasauroidea / GazellePW

Movie-based Gazelle
MIT License
243 stars 58 forks source link

imdb http status code #50

Closed myselfghost closed 1 year ago

myselfghost commented 1 year ago

IN "imdbphp/imdbphp": "^6.5" vendor/imdbphp/imdbphp/src/Imdb/Request.php should add $status == 308

    public function getRedirect()
    {
        $status = $this->getStatus();
        if ($status == 301 || $status == 302 || $status == 303 || $status == 307) {
            foreach ($this->getLastResponseHeaders() as $header) {
                if (strpos(trim(strtolower($header)), 'location') !== 0) {
                    continue;
                }
                $aline = explode(': ', $header);
                $target = trim($aline[1]);
                $urlParts = parse_url($target);
                if (!isset($urlParts['host'])) {
                    $initialRequestUrlParts = parse_url($this->urltoopen);
                    $target = $initialRequestUrlParts['scheme'] . "://" . $initialRequestUrlParts['host'] . $target;
                }
                return $target;
            }
        }
    }
120318 commented 1 year ago

I have bumped imdbphp version to 8.1.