[php-src] Issue #7909: Php curl doesnt redirect
| From: | iluuu1994 | Date: | Fri, 07 Jan 2022 22:33:40 +0000 |
| Subject: | [php-src] Issue #7909: Php curl doesnt redirect | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238867@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7909
Comment Author: iluuu1994
@ejgutierrez74 As @damianwadley suggested, you need to add the following line to your code somewhere
after the
curl_init and before the curl_exec:
```php
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
```
This will make curl make another request when encountering a 30x response instead of
returning that response directly.
Also please not that it might not be a smart idea to share your various secrets on the internet.
Secrets / API Keys are intended for only your eyes. If you share them other people will be able to
login with your user and do harmful things.