Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

没有User-Agent会报500 #3344

Closed
zfhslfgit opened this issue Dec 28, 2018 · 2 comments
Closed

没有User-Agent会报500 #3344

zfhslfgit opened this issue Dec 28, 2018 · 2 comments

Comments

@zfhslfgit
Copy link

zfhslfgit commented Dec 28, 2018

没有User-Agent会报500

php不带user-agent过来的话会报500

<?php
$ch = curl_init();
//        $timeout = 5;
        // $header = ['User-Agent:PHP'];
//
        // curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        curl_setopt($ch, CURLOPT_URL, 'http://localhost:7001/ext/campaign/sylphy-ev-gallery.html');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
        // 不校验证书
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

        curl_exec($ch);
        $info = curl_getinfo($ch);


        // dump(curl_error($ch));
        var_dump($info);

        curl_close($ch);
@egg-bot
Copy link

egg-bot commented Dec 28, 2018

Hello @zfhslfgit. Please provide a reproducible example following the instruction.

Issues labeled by Need Reproduce will be closed if no activities in 7 days.


@zfhslfgit,请根据这个说明提供最小可复现代码。

如果在 7 天内没有进展会被自动关闭。

1 similar comment
@egg-bot
Copy link

egg-bot commented Dec 28, 2018

Hello @zfhslfgit. Please provide a reproducible example following the instruction.

Issues labeled by Need Reproduce will be closed if no activities in 7 days.


@zfhslfgit,请根据这个说明提供最小可复现代码。

如果在 7 天内没有进展会被自动关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants