包含 Referer Header
curl 'https://img-blog.csdnimg.cn/b73c727692ee415faf71d043859da8cb.png' \
-H 'authority: img-blog.csdnimg.cn' \
-H 'accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8' \
-H 'accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
-H 'dnt: 1' \
-H 'referer: http://localhost:8090/' \
-H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: image' \
-H 'sec-fetch-mode: no-cors' \
-H 'sec-fetch-site: cross-site' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
--compressed -v
* Trying 125.64.3.147:443...
* Connected to img-blog.csdnimg.cn (125.64.3.147) port 443 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/cert.pem
* CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN: server accepted h2
* Server certificate:
* subject: CN=*.csdnimg.cn
* start date: Oct 11 00:00:00 2022 GMT
* expire date: Oct 11 23:59:59 2023 GMT
* subjectAltName: host "img-blog.csdnimg.cn" matched cert's "*.csdnimg.cn"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=RapidSSL RSA CA 2018
* SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: GET]
* h2h3 [:path: /b73c727692ee415faf71d043859da8cb.png]
* h2h3 [:scheme: https]
* h2h3 [:authority: img-blog.csdnimg.cn]
* h2h3 [accept-encoding: deflate, gzip]
* h2h3 [authority: img-blog.csdnimg.cn]
* h2h3 [accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8]
* h2h3 [accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7]
* h2h3 [dnt: 1]
* h2h3 [referer: http://localhost:8090/]
* h2h3 [sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"]
* h2h3 [sec-ch-ua-mobile: ?0]
* h2h3 [sec-ch-ua-platform: "macOS"]
* h2h3 [sec-fetch-dest: image]
* h2h3 [sec-fetch-mode: no-cors]
* h2h3 [sec-fetch-site: cross-site]
* h2h3 [user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36]
* Using Stream ID: 1 (easy handle 0x14680a800)
> GET /b73c727692ee415faf71d043859da8cb.png HTTP/2
> Host: img-blog.csdnimg.cn
> accept-encoding: deflate, gzip
> authority: img-blog.csdnimg.cn
> accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
> accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7
> dnt: 1
> referer: http://localhost:8090/
> sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"
> sec-ch-ua-mobile: ?0
> sec-ch-ua-platform: "macOS"
> sec-fetch-dest: image
> sec-fetch-mode: no-cors
> sec-fetch-site: cross-site
> user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
>
< HTTP/2 403
< server: openresty
< date: Wed, 14 Jun 2023 09:35:59 GMT
< content-type: text/html
< content-length: 552
< via: CHN-SCchengdu-AREACT11-CACHE3[1]
< access-control-allow-origin: *
< cache-control: max-age=0
<
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>openresty</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
* Connection #0 to host img-blog.csdnimg.cn left intact
不包含 Referer Header
curl 'https://img-blog.csdnimg.cn/b73c727692ee415faf71d043859da8cb.png' \
-H 'authority: img-blog.csdnimg.cn' \
-H 'accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8' \
-H 'accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
-H 'dnt: 1' \
-H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: image' \
-H 'sec-fetch-mode: no-cors' \
-H 'sec-fetch-site: cross-site' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
--compressed -v
* Trying 125.64.3.146:443...
* Connected to img-blog.csdnimg.cn (125.64.3.146) port 443 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/cert.pem
* CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN: server accepted h2
* Server certificate:
* subject: CN=*.csdnimg.cn
* start date: Oct 11 00:00:00 2022 GMT
* expire date: Oct 11 23:59:59 2023 GMT
* subjectAltName: host "img-blog.csdnimg.cn" matched cert's "*.csdnimg.cn"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=RapidSSL RSA CA 2018
* SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: GET]
* h2h3 [:path: /b73c727692ee415faf71d043859da8cb.png]
* h2h3 [:scheme: https]
* h2h3 [:authority: img-blog.csdnimg.cn]
* h2h3 [accept-encoding: deflate, gzip]
* h2h3 [authority: img-blog.csdnimg.cn]
* h2h3 [accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8]
* h2h3 [accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7]
* h2h3 [dnt: 1]
* h2h3 [sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"]
* h2h3 [sec-ch-ua-mobile: ?0]
* h2h3 [sec-ch-ua-platform: "macOS"]
* h2h3 [sec-fetch-dest: image]
* h2h3 [sec-fetch-mode: no-cors]
* h2h3 [sec-fetch-site: cross-site]
* h2h3 [user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36]
* Using Stream ID: 1 (easy handle 0x12480a800)
> GET /b73c727692ee415faf71d043859da8cb.png HTTP/2
> Host: img-blog.csdnimg.cn
> accept-encoding: deflate, gzip
> authority: img-blog.csdnimg.cn
> accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
> accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7
> dnt: 1
> sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114"
> sec-ch-ua-mobile: ?0
> sec-ch-ua-platform: "macOS"
> sec-fetch-dest: image
> sec-fetch-mode: no-cors
> sec-fetch-site: cross-site
> user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
>
< HTTP/2 200
< date: Wed, 14 Jun 2023 09:36:55 GMT
< content-type: image/png
< content-length: 73965
< server: openresty
< content-md5: Eq5BQjd28OvYBrLGC0BggQ==
< etag: "12AE41423776F0EBD806B2C60B406081"
< last-modified: Fri, 02 Dec 2022 08:48:30 GMT
< x-oss-hash-crc64ecma: 16919009278509492470
< x-oss-object-type: Normal
< x-oss-request-id: 63F627F3C0D4493937C4CFA1
< x-oss-server-time: 48
< x-oss-storage-class: Standard
< x-ccdn-expires: 30610317
< via: CHN-SCchengdu-AREACT11-CACHE60[2],CHN-SCchengdu-AREACT11-CACHE23[0,TCP_HIT,0],CHN-GDdongguan-GLOBAL1-CACHE30[19],CHN-GDdongguan-GLOBAL1-CACHE23[0,TCP_HIT,18]
< x-hcs-proxy-type: 1
< x-ccdn-cachettl: 31104000
< nginx-hit: 1
< accept-ranges: bytes
< access-control-allow-origin: *
< cache-control: max-age=31104000
<
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
* Failure writing output to destination
* Connection #0 to host img-blog.csdnimg.cn left intact