cool hit counter Positive proxy access to Tencent cloud cos when http405_Intefrankly

Positive proxy access to Tencent cloud cos when http405


When using a forward proxy to request cos resources, cos support for the http protocol is more rigorous and less "forgiving". Maybe it's better to be a little more careful with the http protocol

Request details in response to 405

GET http://nfs-test.cosgz.myqcloud.com/user_logo/1000293461_50x50.jpg?sign=testsign HTTP/1.1
Host: nfs-test.cosgz.myqcloud.com
User-Agent: curl
Accept: */*

HTTP/1.1 405 Error
Server: TencentCOS
Content-Type: text/octet
ServerIP: 127.1.1.1
Content-Length: 78

{"errorcode":-46152,"errormsg":"bucket name has illegal char, retcode:-46152"}

A normal request should be

GET /user_logo/1000293461_50x50.jpg?sign=testsign HTTP/1.1
User-Agent: curl/7.29.0
Host: nfs-test.cosgz.myqcloud.com
Accept: */*

When using some forward proxies, the GET part of the header will be different from the normal request, and the cos service only recognizes the second way of writing (standard http protocol), but of course there are some sites that are compatible with the first way of writing: look

* Rebuilt URL to: www.baidu.com/
*   Trying proxy-ip...
* Connected to  proxy-ip ( proxy-ip) port 8090 (#0)
* Proxy auth using Basic with user 'mom'
> GET http://www.baidu.com/ HTTP/1.1
> Host: www.baidu.com
> Proxy-Authorization: Basic uuuuuuuuuuuuu
> User-Agent: curl
> Accept: */*
> 
< HTTP/1.1 200 OK
< Accept-Ranges: bytes

If you still use http, the 1.1 protocol, the forward proxy must have channel mode turned on so that the forward proxy's get header collocation stops and access to the cos is normal, like this

curl -v --proxy "proxy-ip:8090"   --proxytunnel "http://nfs-test.cosgz.myqcloud.com/user_logo/1000293461_50x50.jpg?sign=your-sign"

Or just use the Https protocol


Recommended>>
1、Recently this company two years ago tax evasion by the Golden Three to turn over the old accounts 2018 Golden Tax III warning more stringent it is more brutal than you can imagine
2、Another Chinese black technology will affect everyone the era of driverless Chinese subways is coming
3、How powerful is the new PowerVR3NX neural network accelerator Imaginations technical experts share with you
4、Last stop for digital currency blockchain now Next divine prediction
5、April New Release Resource Compilation

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号