rustls HTTP请求-响应301
使用 导致重定向消息:rustls HTTP请求-响应301,http,ssl,https,rust,Http,Ssl,Https,Rust,使用 导致重定向消息: Current ciphersuite: TLS13_CHACHA20_POLY1305_SHA256 HTTP/1.1 301 Moved Permanently Location: https://www.google.com/ Content-Type: text/html; charset=UTF-8 Date: Sat, 05 Sep 2020 13:56:25 GMT Expires: Mon, 05 Oct 2020 13:56:25 GMT Cache-C
Current ciphersuite: TLS13_CHACHA20_POLY1305_SHA256
HTTP/1.1 301 Moved Permanently
Location: https://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Sat, 05 Sep 2020 13:56:25 GMT
Expires: Mon, 05 Oct 2020 13:56:25 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 220
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
Alt-Svc: h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Connection: close
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://www.google.com/">here</A>.
</BODY></HTML>
当前密码套件:TLS13\u CHACHA20\u poly 1305\u SHA256
HTTP/1.1 301永久移动
地点:https://www.google.com/
内容类型:text/html;字符集=UTF-8
日期:2020年9月5日星期六13:56:25 GMT
过期时间:2020年10月5日星期一13:56:25 GMT
缓存控制:公共,最大年龄=2592000
服务器:gws
内容长度:220
X-XSS-Protection:0
X-Frame-Options:SAMEORIGIN
Alt Svc:h3-29=“:443”;ma=2592000,h3-27=“:443”;ma=2592000,h3-T051=“:443”;ma=2592000,h3-T050=“:443”;ma=2592000,h3-Q050=“:443”;ma=2592000,h3-Q046=“:443”;ma=2592000,h3-Q043=“:443”;ma=2592000,quic=“:443”;ma=2592000;v=“46,43”
连接:关闭
301移动
301移动
文档已移动
.
这是该示例代码的正确行为吗?我应该更改什么才能收到OK响应
这是该示例代码的正确行为吗
对。使用其他工具尝试相同类型的请求时,也可以检查这一点:
$ curl -v https://google.com
...
< HTTP/1.1 301 Moved Permanently
< Location: https://www.google.com/
$ curl -v https://google.com
...
< HTTP/1.1 301 Moved Permanently
< Location: https://www.google.com/
$ curl -v https://www.google.com
...
< HTTP/1.1 200 OK