0

我想从它向我发送此标头的 URL 中获取内容长度:

HTTP/1.1 301 永久移动日期:2012 年 1 月 1 日星期日 09:34:44 GMT 服务器:Apache 位置:https ://www.sugarsync.com , www.sugarsync.com/pf/D6304231_0192919_76577 Keep-Alive:timeout=300 , max=9793 连接:保持活动内容类型:文本/纯文本;字符集=UTF-8

问题是原始 URL 与此标头中发送的新 URL 相同!换句话说:我从 URL 获取标题:https ://www.sugarsync.com/pf/D6304231_0192919_76577在我得到的标题中,它重定向到同一页面。

4

1 回答 1

0

您提供的网址似乎没有问题:

C:\Users\rleahy>openssl s_client -quiet -connect sugarsync.com:443
Loading 'screen' into random state - done
depth=1 /C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certificates
.godaddy.com/repository/CN=Go Daddy Secure Certification Authority/serialNumber=
07969287
verify error:num=20:unable to get local issuer certificate
verify return:0
HEAD /pf/D6304231_0192919_76577 HTTP/1.1
host:www.sugarsync.com

HTTP/1.1 200 OK
Date: Sun, 01 Jan 2012 10:16:13 GMT
Server: Apache
Set-Cookie: JSESSIONID=22C35505626E63560F5F00BDE86BD458; Path=/; Secure
Content-Disposition: attachment;filename="Algorithms(01).rar"
Accept-Ranges: bytes
Etag: file_1319015834000
Last-Modified: Wed, 19 Oct 2011 09:17:14 GMT
Content-Length: 468987
Content-Type: application/x-download
Set-Cookie: NSC_wt_xxx.tvhbstzod.dpn_443=ffffffff090d78d545525d5f4f58455e445a4a4
2378b;path=/;secure;httponly

你确定你不是用 HTTP 而不是 HTTPS 连接吗?使用 HTTP 连接确实会给出 301(实际上是要求您使用 HTTPS 进行连接)。

于 2012-01-01T10:18:43.257 回答