请求/.well-known/apple-app-site-association

问题描述 投票:49回答:5

我刚检查了我的服务器日志,发现以下奇怪的请求进入了很多。我实现了iOS 9 Universal Linking,但据我所知,这些请求是针对/ apple-app-site-association运行的。

Jan 15 09:36:23 method=GET path="/.well-known/apple-app-site-association"

还有其他人看过这些模式吗?这是一些已知的垃圾邮件还是什么?

ios ios-universal-links
5个回答
29
投票

我相信iOS 9.3围绕apple-app-site-association文件和app切换功能引入了略微不同的查找逻辑。

“切换首先在.well-known子目录中搜索文件(例如,https://example.com/.well-known/apple-app-site-association),如果不使用.well-known子目录,则回退到顶级域名。”

见:https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/AdoptingHandoff/AdoptingHandoff.html#//apple_ref/doc/uid/TP40014338-CH2-SW10


14
投票

我还在我的日志中收到以下内容:

[Mon Feb 29 12:34:53 2016] [error] [source 66.249.75.XXX] File does not exist: /public_path/apple-app-site-association

其中日志中的XXX是0到255之间的数字。

然后,我检查了Whois IP 66.249.69.012 ....... 255

而我发现,所有IP都在66.249.64.0 - 66.249.95.255分配给Google Inc。等等你在开玩笑吧,为什么google在我的服务器上请求apple-app-site-association

因为Google扩展了它的映射,以包含有关Google App Indexing for universal links from Google Search in Safari.网站和特定iOS应用之间关联的信息。

Whois登录IP 66.249.64.0

NetRange:       66.249.64.0 - 66.249.95.255
CIDR:           66.249.64.0/19
NetName:        GOOGLE
NetHandle:      NET-66-249-64-0-1
Parent:         NET66 (NET-66-0-0-0-0)
NetType:        Direct Allocation
OriginAS:       
Organization:   Google Inc. (GOGL)
RegDate:        2004-03-05
Updated:        2012-02-24
Ref:            https://whois.arin.net/rest/net/NET-66-249-64-0-1



OrgName:        Google Inc.
OrgId:          GOGL
Address:        1600 Amphitheatre Parkway
City:           Mountain View
StateProv:      CA
PostalCode:     94043
Country:        US
RegDate:        2000-03-30
Updated:        2015-11-06
Ref:            https://whois.arin.net/rest/org/GOGL


OrgAbuseHandle: ABUSE5250-ARIN
OrgAbuseName:   Abuse
OrgAbusePhone:  +1-650-253-0000 
OrgAbuseEmail:  [email protected]
OrgAbuseRef:    https://whois.arin.net/rest/poc/ABUSE5250-ARIN

OrgTechHandle: ZG39-ARIN
OrgTechName:   Google Inc
OrgTechPhone:  +1-650-253-0000 
OrgTechEmail:  [email protected]
OrgTechRef:    https://whois.arin.net/rest/poc/ZG39-ARIN

5
投票

我们也看到了这种行为。我们服务器的绝大多数访问日志文件现在都是对此特定文件的请求。

如果您正在运行使用nginx在应用程序服务器/框架前提供静态文件的安装程序,请确保验证/.well-known/apple-app-site-association/apple-app-site-association文件是否存在或返回响应。

如果他们不这样做,那么缺失的请求将全部传递给您的框架,这在许多情况下导致必须在确定没有匹配之前处理您的路由。在我们昨天做出改变之前,对我们服务器的额外压力是相当大的。


3
投票

我看到了很多这些请求(有和没有.well-known子目录)。他们来自google-bot,但我想其他蜘蛛也可能在某个时候开始寻找它们。由于我的网站与任何iOS(或Android)应用程序没有任何重叠功能,因此它们浪费带宽。我喜欢@ aramisbear的答案来保护我的应用服务器(https://stackoverflow.com/a/36185061/467590)。但我打算尝试将它们添加到我的robots.txt中。由于google-bot尊重robots.txt(以及其他对创建应用程序索引感兴趣的机器人几乎肯定也会),我认为这样做可以防止浪费甚至我的nginx代理的带宽。


1
投票

自从iOS 9.3 Apple将首先尝试下载/.well-known/apple-app-site-association,如果它失败,它将退回到/apple-app-site-association

看Apple的Technical Q&A QA1919

Incoming requests for /.well-known/apple-app-site-association file

问:为什么我的网络服务器收到https://example.com/.well-known/apple-app-site-association的请求?

答:最近发布的iOS 9.3更新实现了RFC 5785。因此,运行iOS 9.3的设备将首先为/.well-known/apple-app-site-association文件请求apple-app-site-association,这是实现Universal LinksShared Web Credentials所必需的。如果在此位置找不到该文件,则设备将在Web服务器的根目录中请求该文件,与之前版本的iOS 9一样。

© www.soinside.com 2019 - 2024. All rights reserved.