
奇怪的是如上图示已经在XX站后台设置允许www.mzwu.com外链,但从mzwu上转到资源下载链接时还是跳转到了防盗链页面,允许链接本站的域名设置失效了!什么原因呢?搜索到新云防盗链相关代码:
Public Function CheckOutLinks()
On Error Resume Next
Dim server_v1,server_v2,i,Allowlists
CheckOutLinks=False
If Trim(MainSetting(49))="*" Then
CheckOutLinks=True
Exit Function
End If
server_v1 = LCase(Request.ServerVariables("HTTP_REFERER"))
server_v2 = LCase(Request.ServerVariables("SERVER_NAME"))
Allowlists = server_v2&","&MainSetting(49)
Allowlists=Split(LCase(Allowlists),",")
If Len(server_v1)>1 Then
If InStr(9,server_v1,"/")>0 Then server_v1=Mid(server_v1,1,InStr(9,server_v1,"/"))
For i=0 to Ubound(Allowlists)
If InStr(server_v1,Allowlists(i))>0 And Len(Allowlists(i))>1 Then
CheckOutLinks=True
Exit For
End If
Next
Else
CheckOutLinks=False
End If
End Function代码没问题,难道Request.ServerVariables("HTTP_REFERER")接收有问题?在XX站上增加了一个页面专门获取HTTP_REFERER的值并显示,得到的是空值!最终发现是mzwu上使用Response.Redirect在服务器端跳转到资源地址下载,而使用Response.Redirect跳转Request.ServerVariables("HTTP_REFERER")获取不到值,目前没有解决方法😢
评论(0)
暂无评论。