Http 为什么要推特';s t.co出现在Referer中,但没有URL缩短器出现?

Http 为什么要推特';s t.co出现在Referer中,但没有URL缩短器出现?,http,url-rewriting,url-routing,url-redirection,http-referer,Http,Url Rewriting,Url Routing,Url Redirection,Http Referer,我注意到在我的access_log文件中有一大堆Referer链接,比如t.co/oPQO7Xdz,但没有其他URL缩写出现。为什么?URL缩写永远不会出现,因为HTTP中的重定向不是为影响URL而设计的(显然,即使标头为空,也不会,这可能是因为它会导致行为不一致) 然而,如果Twitter看到它认为是流行的桌面或移动用户代理,它不会在其t.co服务中发出重定向。由于重定向是在HTTP堆栈之外完成的,因此随后全新HTTP请求中的Referer字段将被组合成包括负责重定向的先前HTML页面,从而导

我注意到在我的
access_log
文件中有一大堆
Referer
链接,比如
t.co/oPQO7Xdz
,但没有其他URL缩写出现。为什么?

URL缩写永远不会出现,因为HTTP中的重定向不是为影响URL而设计的(显然,即使标头为空,也不会,这可能是因为它会导致行为不一致)

然而,如果Twitter看到它认为是流行的桌面或移动
用户代理
,它不会在其
t.co
服务中发出重定向。由于重定向是在HTTP堆栈之外完成的,因此随后全新HTTP请求中的
Referer
字段将被组合成包括负责重定向的先前HTML页面,从而导致
t.co
条目出现在
access\u log

% curl -v -A"iPhone;" t.co/oPQO7Xdz
* About to connect() to t.co port 80 (#0)
*   Trying 104.244.42.5...
* connected
* Connected to t.co (104.244.42.5) port 80 (#0)
> GET /oPQO7Xdz HTTP/1.1
> User-Agent: iPhone;
> Host: t.co
> Accept: */*
>
< HTTP/1.1 200 OK
< cache-control: private,max-age=300
< content-length: 258
< content-security-policy: referrer always;
< content-type: text/html; charset=utf-8
< date: Thu, 07 Jul 2016 05:24:16 GMT
< expires: Thu, 07 Jul 2016 05:29:16 GMT
< server: tsa_o
< set-cookie: muc=1f43e292-e319-4818-ba81-f12d16e5b629; Expires=Tue, 19 Jun 2018 05:24:16 UTC; Domain=t.co
< x-connection-hash: 0dc5a2a6a7e83ac2d7fb207eb0cedf84
< x-response-time: 115
< x-xss-protection: 1; mode=block
<
* Connection #0 to host t.co left intact
<head><meta name="referrer" content="always"><noscript><META http-equiv="refresh" content="0;URL=http://mdoc.su/n/curl"></noscript><title>http://mdoc.su/n/curl</title></head><script>window.opener = null; location.replace("http:\/\/mdoc.su\/n\/curl")</script>* Closing connection #0

URL缩短器永远不会出现,因为HTTP中的重定向不是为了影响URL而设计的(显然,即使标头为空,也不会,这可能是因为它会导致行为不一致)

然而,如果Twitter看到它认为是流行的桌面或移动
用户代理
,它不会在其
t.co
服务中发出重定向。由于重定向是在HTTP堆栈之外完成的,因此随后全新HTTP请求中的
Referer
字段将被组合成包括负责重定向的先前HTML页面,从而导致
t.co
条目出现在
access\u log

% curl -v -A"iPhone;" t.co/oPQO7Xdz
* About to connect() to t.co port 80 (#0)
*   Trying 104.244.42.5...
* connected
* Connected to t.co (104.244.42.5) port 80 (#0)
> GET /oPQO7Xdz HTTP/1.1
> User-Agent: iPhone;
> Host: t.co
> Accept: */*
>
< HTTP/1.1 200 OK
< cache-control: private,max-age=300
< content-length: 258
< content-security-policy: referrer always;
< content-type: text/html; charset=utf-8
< date: Thu, 07 Jul 2016 05:24:16 GMT
< expires: Thu, 07 Jul 2016 05:29:16 GMT
< server: tsa_o
< set-cookie: muc=1f43e292-e319-4818-ba81-f12d16e5b629; Expires=Tue, 19 Jun 2018 05:24:16 UTC; Domain=t.co
< x-connection-hash: 0dc5a2a6a7e83ac2d7fb207eb0cedf84
< x-response-time: 115
< x-xss-protection: 1; mode=block
<
* Connection #0 to host t.co left intact
<head><meta name="referrer" content="always"><noscript><META http-equiv="refresh" content="0;URL=http://mdoc.su/n/curl"></noscript><title>http://mdoc.su/n/curl</title></head><script>window.opener = null; location.replace("http:\/\/mdoc.su\/n\/curl")</script>* Closing connection #0