Redirect 从重定向到自身的URL获取内容长度

Redirect 从重定向到自身的URL获取内容长度,redirect,header,http-content-length,Redirect,Header,Http Content Length,我想从URL获取内容长度,该URL向我发送此标题: HTTP/1.1 301永久移动日期:Sun,2012年1月1日09:34:44 GMT服务器:Apache位置:,www.sugarsync.com/pf/D6304231_0192919_76577保持活动:超时=300,最大=9793连接:保持活动内容类型:text/plain;字符集=UTF-8 问题是,原始URL与此标头中发送的新URL相同!换句话说:我从URL获取标题:在我获取的标题中,它重定向到同一页面。您提供的URL似乎没有问题

我想从URL获取内容长度,该URL向我发送此标题:

HTTP/1.1 301永久移动日期:Sun,2012年1月1日09:34:44 GMT服务器:Apache位置:,www.sugarsync.com/pf/D6304231_0192919_76577保持活动:超时=300,最大=9793连接:保持活动内容类型:text/plain;字符集=UTF-8


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

您提供的URL似乎没有问题:

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连接)