如果您已登录,此URL:https://download.ama-assn.org/resources/doc/usan/x-pub/usan-february-2014-newsletter.pdf返回html页面:
<div id="dlblock">
<a href="http://www.ama-assn.org">
<img src="https://www.ama-assn.org/resources/images/header/ama-logo.png" border="0">
</a><br><br>
You are about to download<br>
<strong>
<a id="file-link" href="/resources/doc/usan/x-pub/usan-february-2014-newsletter.pdf" target="_blank">usan-february-2014-newsletter.pdf</a>
</strong>
If you are not automatically redirected, please
<a href="/resources/doc/usan/x-pub/usan-february-2014-newsletter.pdf" target="_blank">click here</a>
to begin your download. <br><br>
<small>Copyright 1995-2014
<a href="http://www.ama-assn.org">American Medical Association</a> All rights reserved.
</small>
如果您单击此页面上的链接( url是刚刚在新窗口中打开的同一页),您将得到pdf。
我不明白服务器如何决定什么时候提供html和pdf --这是如何实现的?
发布于 2014-04-07 20:20:32
服务器可以读取http referer请求头,如果它与页面的URL匹配,则提供PDF版本。
https://stackoverflow.com/questions/22922195
复制相似问题