我使用 mapResources() 和 parseExtensions() 设置了一个 RESTful API 并使用 CakePHP。身份验证由 CakePHP 的安全组件使用 HTTP Digest Authentication 处理。
一切正常,除非我在 url 中添加参数,格式如下:
http://example.com/locations.xml?distance=4
这会导致身份验证始终失败。有任何想法吗?
编辑: 这似乎是 parseDigestAuthData() 中的正则表达式的问题。这里有一个半修复:http: //old.nabble.com/paginator-conflicts-with-Security-%3ErequireLogin---td16301573.html现在允许我使用以下格式:
http://example.com/locations/index/distance:4/.xml
但这不是 RESTful,而且看起来也不那么漂亮。还是越来越近了!